Skip to content

Commit

Permalink
More cargo updates (#532)
Browse files Browse the repository at this point in the history
* More cargo updates

* Fixes

* Fix

* OBS trade station now sells AK47

* Updates, updates!

* Stuff

* Indent fix

* Spawn always on terra trader

* Fixes wrong typepath

* SMG tweaks

* Fixes

* Some sniper fixes

* Bunch of tweaks

* Railgun buffs

* fix

* Organ worth tweaks

* Some tweaks
  • Loading branch information
EgorDinamit authored Feb 13, 2024
1 parent 81b2efe commit faae0ea
Show file tree
Hide file tree
Showing 43 changed files with 510 additions and 176 deletions.
1 change: 1 addition & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3294,6 +3294,7 @@
#include "code\modules\trading_stations\trading_station_types\0_always_spawn\materials.dm"
#include "code\modules\trading_stations\trading_station_types\0_always_spawn\medical.dm"
#include "code\modules\trading_stations\trading_station_types\0_always_spawn\security.dm"
#include "code\modules\trading_stations\trading_station_types\0_always_spawn\terra.dm"
#include "code\modules\trading_stations\trading_station_types\2_rare\weapons.dm"
#include "code\modules\trading_stations\trading_station_types\3_very_rare\obs.dm"
#include "code\modules\trusted-players\procs.dm"
Expand Down
4 changes: 4 additions & 0 deletions code/__defines/guns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#define CALIBER_REVOLVER_MEDIUM ".357 Special"
#define CALIBER_REVOLVER_HEAVY ".454 Casull"

#define CALIBER_SMG "10mmS"
#define CALIBER_SMG_SMALL "7mmS"
#define CALIBER_SMG_FLECHETTE "4mmS"

#define CALIBER_RIFLE "5mmR"
#define CALIBER_RIFLE_MILITARY "7mmR"
#define CALIBER_T12 "10x24mmR"
Expand Down
2 changes: 2 additions & 0 deletions code/__defines/supply.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// Trade categories for the sake of standardization
#define TRADE_CAT_WEAPONS "Weapons"
#define TRADE_CAT_AMMO "Ammunition"
#define TRADE_CAT_ARTILLERY "Artillery"
#define TRADE_CAT_ARMOR "Armor"
#define TRADE_CAT_EQUIPMENT "Equipment"
#define TRADE_CAT_CLOTHING "Clothing"
Expand All @@ -22,6 +23,7 @@
#define TRADE_CAT_MEDICAL "Medical"
#define TRADE_CAT_MEDKIT "Medical Kits"
#define TRADE_CAT_CHEMICAL "Chemical"
#define TRADE_CAT_CHEMCARTS "Chemical Cartridges"

// As in - faction is a part of us
#define FACTION_STATE_PROTECTORATE 4
Expand Down
5 changes: 5 additions & 0 deletions code/_global_vars/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,8 @@ GLOBAL_LIST_INIT(t12_sound,\
'sound/weapons/gunshot/autorifle-1.ogg',\
'sound/weapons/gunshot/autorifle-2.ogg',\
'sound/weapons/gunshot/autorifle-3.ogg'))

GLOBAL_LIST_INIT(mp38_sound,\
list(\
'sound/weapons/gunshot/mp38_1.ogg',
'sound/weapons/gunshot/mp38_2.ogg'))
27 changes: 14 additions & 13 deletions code/controllers/subsystems/supply.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,22 @@ SUBSYSTEM_DEF(supply)
for(var/tf in factions)
var/datum/trade_faction/TF = factions[tf]
for(var/tf2 in factions)
var/datum/trade_faction/TF2 = factions[tf]
var/datum/trade_faction/TF2 = factions[tf2]
if(TF == TF2)
// Technically not, but this will be how we declare same faction relations for now
TF.relationship[TF2.name] = FACTION_STATE_PROTECTORATE
continue
if(!(TF2.name in TF.relationship))
TF.relationship[TF2] = FACTION_STATE_NEUTRAL
// This ensures that relations are always mirrored between two datums
SetFactionRelations(TF, TF2, TF.relationship[TF2])

// Now we set it to neutral for the missing ones
for(var/tf in factions)
var/datum/trade_faction/TF = factions[tf]
for(var/tf2 in factions)
var/datum/trade_faction/TF2 = factions[tf2]
if(!(TF2.name in TF.relationship))
SetFactionRelations(TF, TF2, FACTION_STATE_NEUTRAL)

InitTradeStations()

/datum/controller/subsystem/supply/Destroy()
Expand Down Expand Up @@ -194,15 +200,7 @@ SUBSYSTEM_DEF(supply)
if(!seller_faction)
return

switch(seller_faction.relationship[buyer_faction.name])
if(FACTION_STATE_ANIMOSITY)
. *= 1.25
if(FACTION_STATE_RIVAL)
. *= 1.5
if(FACTION_STATE_ENEMY)
. *= 2.0
if(FACTION_STATE_WAR) // Normally that'd be an embargo, but some outlaw traders exist
. *= 3.0
. *= station.GetFactionMarkup(buyer_faction)

if(buyer_faction.name in seller_faction.trade_markup)
. *= seller_faction.trade_markup[buyer_faction.name]
Expand Down Expand Up @@ -385,7 +383,10 @@ SUBSYSTEM_DEF(supply)
qdel(item)
++export_count
else if(item != AM)
item.forceMove(get_turf(AM)) // Should be the same tile
if(!isobj(item) || !ismob(item))
qdel(item)
else
item.forceMove(get_turf(AM)) // Should be the same tile

// The max is a soft cap
if(export_count > 100)
Expand Down
17 changes: 15 additions & 2 deletions code/game/machinery/trade_beacon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
icon_state = "beacon"
anchored = TRUE
density = TRUE
var/beacon_range = 2

/obj/machinery/trade_beacon/attackby(obj/item/W, mob/user)
if(isMultitool(W))
beacon_range = beacon_range >= 2 ? 1 : 2
anchored = !anchored
user.visible_message(
SPAN_NOTICE("\The [user] pulses some circuitry within [src]."),
SPAN_NOTICE("You set [src]'s effective range to [beacon_range].")
)
playsound(src.loc, "sound/effects/pop.ogg", 50)
return
return ..()

/obj/machinery/trade_beacon/proc/Activate()
flick("[icon_state]_active", src)
Expand Down Expand Up @@ -32,7 +45,7 @@

/obj/machinery/trade_beacon/sending/proc/GetObjects()
var/list/objects = list()
for(var/atom/movable/A in range(2, src))
for(var/atom/movable/A in range(beacon_range, src))
if(A.anchored)
continue
if(A == src)
Expand Down Expand Up @@ -65,7 +78,7 @@

/obj/machinery/trade_beacon/receiving/proc/DropItem(drop_type)
var/list/valid_turfs = list()
for(var/turf/simulated/floor/F in range(2, src))
for(var/turf/simulated/floor/F in range(beacon_range, src))
if(F.contains_dense_objects(TRUE))
continue
valid_turfs += F
Expand Down
6 changes: 5 additions & 1 deletion code/game/objects/items/weapons/storage/boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,11 @@

/obj/item/storage/box/ammo/sniperammo/apds
name = "box of sniper APDS shells"
startswith = list(/obj/item/ammo_casing/shell/apds = 3)
startswith = list(/obj/item/ammo_casing/shell/apds = 7)

/obj/item/storage/box/ammo/sniperammo/explosive
name = "box of sniper explosive shells"
startswith = list(/obj/item/ammo_casing/shell/explosive = 7)

/obj/item/storage/box/flashbangs
name = "box of flashbangs"
Expand Down
1 change: 1 addition & 0 deletions code/game/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ var/const/FALLOFF_SOUNDS = 0.5
if ("glasscrack") soundin = pick(GLOB.glasscrack_sound)
if ("tray_hit") soundin = pick(GLOB.tray_hit_sound)
if ("gun_t12") soundin = pick(GLOB.t12_sound)
if ("gun_mp38") soundin = pick(GLOB.mp38_sound)
return soundin

/client/verb/stop_sounds()
Expand Down
8 changes: 4 additions & 4 deletions code/modules/fabrication/designs/general/designs_arms_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
name = "ammunition (shotgun, flash)"
path = /obj/item/ammo_casing/shotgun/flash

/datum/fabricator_recipe/arms_ammo/hidden/magazine_smg_rubber
name = "ammunition (SMG rubber) top mounted"
path = /obj/item/ammo_magazine/smg_top/rubber

/datum/fabricator_recipe/arms_ammo/hidden/flamethrower
path = /obj/item/flamethrower/full

Expand Down Expand Up @@ -72,6 +68,10 @@
name = "ammunition (submachine gun)"
path = /obj/item/ammo_magazine/smg

/datum/fabricator_recipe/arms_ammo/hidden/magazine_smg_rubber
name = "ammunition (SMG rubber) top mounted"
path = /obj/item/ammo_magazine/smg_top/rubber

/datum/fabricator_recipe/arms_ammo/hidden/magazine_uzi
name = "ammunition (machine pistol)"
path = /obj/item/ammo_magazine/machine_pistol
Expand Down
23 changes: 21 additions & 2 deletions code/modules/item_worth/value_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@
return base * Uses

/obj/item/ammo_casing/Value(base)
. = ..()
if(!BB)
return 1
return ..()
return

for(var/mat in matter)
var/material/material_def = SSmaterials.get_material_by_name(mat)
. += material_def.value * (matter[mat] / SHEET_MATERIAL_AMOUNT)

. = round(., 0.5)

/obj/item/reagent_containers/Value(base)
. = ..()
Expand Down Expand Up @@ -66,3 +72,16 @@
if(!key) // Mindless humans cost less
. *= 0.2
. = round(.)

/obj/structure/ship_munition/disperser_charge/explosive/Value(base)
. = ..()
. += devastation_modifier * 10000

/obj/structure/ship_munition/disperser_charge/orbital_bombardment/Value(base)
. = ..()
. += bomb_number * (devastation_modifier * 2000)

/obj/item/organ/Value(base)
. = ..()
if(damage)
. -= round(. * (damage / max_damage))
Loading

0 comments on commit faae0ea

Please sign in to comment.