Skip to content

Commit

Permalink
Merge pull request #961 from wraith-54321/guns-ports
Browse files Browse the repository at this point in the history
Ports Microfusion Energy Guns
  • Loading branch information
dwasint authored Feb 12, 2024
2 parents ce917ec + 66ea3ad commit 15e83b1
Show file tree
Hide file tree
Showing 272 changed files with 4,379 additions and 1,230 deletions.
4 changes: 3 additions & 1 deletion code/__DEFINES/atom_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@
/// Mech camera HUD
#define DIAG_CAMERA_HUD "22"

//monkestation edit start
#define NANITE_HUD "23"
#define DIAG_NANITE_FULL_HUD "24"
// for gun permit
#define PERMIT_HUD "25"
//monkestation edit end

//by default everything in the hud_list of an atom is an image
//a value in hud_list with one of these will change that behavior
Expand All @@ -67,7 +69,7 @@
#define DATA_HUD_SENTIENT_DISEASE 8
#define DATA_HUD_AI_DETECT 9
#define DATA_HUD_FAN 10
#define DATA_HUD_PERMIT 11
#define DATA_HUD_PERMIT 11 //monkestation edit

// Notification action types
#define NOTIFY_JUMP "jump"
Expand Down
10 changes: 8 additions & 2 deletions code/__DEFINES/construction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,14 @@
//windows affected by Nar'Sie turn this color.
#define NARSIE_WINDOW_COLOUR "#7D1919"

//The amount of materials you get from a sheet of mineral like iron/diamond/glass etc
#define MINERAL_MATERIAL_AMOUNT 2000
// Defines related to the custom materials used on objects.
///The amount of materials you get from a sheet of mineral like iron/diamond/glass etc. 100 Units.
#define SHEET_MATERIAL_AMOUNT 2000
///The amount of materials you get from half a sheet. Used in standard object quantities. 50 units.
#define HALF_SHEET_MATERIAL_AMOUNT (SHEET_MATERIAL_AMOUNT/2)
///The amount of materials used in the smallest of objects, like pens and screwdrivers. 10 units.
#define SMALL_MATERIAL_AMOUNT (HALF_SHEET_MATERIAL_AMOUNT/5)

//The maximum size of a stack object.
#define MAX_STACK_SIZE 50
//maximum amount of cable in a coil
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ GLOBAL_LIST_INIT(detective_vest_allowed, list(
/obj/item/flashlight,
/obj/item/gun/ballistic,
/obj/item/gun/energy,
/obj/item/gun/microfusion, //monkestation edit
/obj/item/lighter,
/obj/item/melee/baton,
/obj/item/reagent_containers/spray/pepper,
Expand All @@ -191,6 +192,7 @@ GLOBAL_LIST_INIT(security_vest_allowed, list(
/obj/item/flashlight,
/obj/item/gun/ballistic,
/obj/item/gun/energy,
/obj/item/gun/microfusion, //monkestation edit
/obj/item/knife/combat,
/obj/item/melee/baton,
/obj/item/reagent_containers/spray/pepper,
Expand All @@ -208,6 +210,7 @@ GLOBAL_LIST_INIT(security_wintercoat_allowed, list(
/obj/item/ammo_casing,
/obj/item/gun/ballistic,
/obj/item/gun/energy,
/obj/item/gun/microfusion, //monkestation edit
/obj/item/melee/baton,
/obj/item/reagent_containers/spray/pepper,
/obj/item/restraints/handcuffs,
Expand Down
4 changes: 2 additions & 2 deletions code/__DEFINES/materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@


// Slowdown values.
/// The slowdown value of one [MINERAL_MATERIAL_AMOUNT] of plasteel.
/// The slowdown value of one [SHEET_MATERIAL_AMOUNT] of plasteel.
#define MATERIAL_SLOWDOWN_PLASTEEL (0.05)
/// The slowdown value of one [MINERAL_MATERIAL_AMOUNT] of alien alloy.
/// The slowdown value of one [SHEET_MATERIAL_AMOUNT] of alien alloy.
#define MATERIAL_SLOWDOWN_ALIEN_ALLOY (0.1)
55 changes: 55 additions & 0 deletions code/__DEFINES/~monkestation/microfusion.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/// The amount of cell charge drained during a drain failure.
#define MICROFUSION_CELL_DRAIN_FAILURE 500
/// The heavy EMP range for when a cell suffers an EMP failure.
#define MICROFUSION_CELL_EMP_HEAVY_FAILURE 2
/// The light EMP range for when a cell suffers an EMP failure.
#define MICROFUSION_CELL_EMP_LIGHT_FAILURE 4
/// The radiation range for when a cell suffers a radiation failure.
#define MICROFUSION_CELL_RADIATION_RANGE_FAILURE 1

/// The lower most time for a microfusion cell meltdown.
#define MICROFUSION_CELL_FAILURE_LOWER (10 SECONDS)
/// The upper most time for a microfusion cell meltdown.
#define MICROFUSION_CELL_FAILURE_UPPER (15 SECONDS)

/// A charge drain failure.
#define MICROFUSION_CELL_FAILURE_TYPE_CHARGE_DRAIN 1
/// A small explosion failure.
#define MICROFUSION_CELL_FAILURE_TYPE_EXPLOSION 2
/// EMP failure.
#define MICROFUSION_CELL_FAILURE_TYPE_EMP 3
/// Radiation failure.
#define MICROFUSION_CELL_FAILURE_TYPE_RADIATION 4

/// Returned when the phase emtiter process is successful.
#define SHOT_SUCCESS "success"
/// Returned when a gun is fired but there is no phase emitter.
#define SHOT_FAILURE_NO_EMITTER "no phase emitter!"

/// The error message returned when the phase emitter is processed but damaged.
#define PHASE_FAILURE_DAMAGED "PHASE EMITTER: Emitter damaged!"
/// The error message returned when the phase emitter has reached it's htermal throttle.
#define PHASE_FAILURE_THROTTLE "PHASE EMITTER: Thermal throttle active!"

/// The heat dissipation bonus of an emitter being in space!
#define PHASE_HEAT_DISSIPATION_BONUS_SPACE 30
/// The heat dissipation bonus of an emitter being in air!
#define PHASE_HEAT_DISSIPATION_BONUS_AIR 10

// Slot defines for the gun.
/// The gun barrel slot.
#define GUN_SLOT_BARREL "barrel"
/// The gun underbarrel slot.
#define GUN_SLOT_UNDERBARREL "underbarrel"
/// The gun rail slot.
#define GUN_SLOT_RAIL "rail"
/// Unique slots, can hold as many as you want.
#define GUN_SLOT_UNIQUE "unique"
/// Camo slot. Because why would you put four overlapping camos on your gun?
#define GUN_SLOT_CAMO "camo"

/// Max name size for changing names
#define GUN_MAX_NAME_CHARS 20
/// Min name size for changing names
#define GUN_MIN_NAME_CHARS 3

2 changes: 1 addition & 1 deletion code/datums/components/crafting/guncrafting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/obj/item/weaponcrafting/stock
name = "rifle stock"
desc = "A classic rifle stock that doubles as a grip, roughly carved out of wood."
custom_materials = list(/datum/material/wood = MINERAL_MATERIAL_AMOUNT * 6)
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 6)
resistance_flags = FLAMMABLE
icon = 'icons/obj/weapons/improvised.dmi'
icon_state = "riflestock"
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/grillable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/// REF() to the mind which placed us on the griddle
var/who_placed_us

/// What type of pollutant we spread around as we are grilleed, can be none // SKYRAT EDIT ADDITION
/// What type of pollutant we spread around as we are grilleed, can be none // MONKESTATION EDIT ADDITION
var/pollutant_type

/datum/component/grillable/Initialize(cook_result, required_cook_time, positive_result, use_large_steam_sprite, pollutant_type)
Expand Down
26 changes: 13 additions & 13 deletions code/datums/components/material_container.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This datum should be used for handling mineral contents of machines and whatever else is supposed to hold minerals and make use of them.
Variables:
amount - raw amount of the mineral this container is holding, calculated by the defined value MINERAL_MATERIAL_AMOUNT=2000.
amount - raw amount of the mineral this container is holding, calculated by the defined value SHEET_MATERIAL_AMOUNT=SHEET_MATERIAL_AMOUNT.
max_amount - max raw amount of mineral this container can hold.
sheet_type - type of the mineral sheet the container handles, used for output.
parent - object that this container is being used by, used for output.
Expand Down Expand Up @@ -295,7 +295,7 @@
return (max_amount - total_amount)


/// For consuming a dictionary of materials. mats is the map of materials to use and the corresponding amounts, example: list(M/datum/material/glass =100, datum/material/iron=200)
/// For consuming a dictionary of materials. mats is the map of materials to use and the corresponding amounts, example: list(M/datum/material/glass =100, datum/material/iron=SMALL_MATERIAL_AMOUNT * 2)
/datum/component/material_container/proc/use_materials(list/mats, multiplier=1)
if(!mats || !length(mats))
return FALSE
Expand Down Expand Up @@ -333,18 +333,18 @@
if(!target)
var/atom/parent_atom = parent
target = parent_atom.drop_location()
if(materials[M] < (sheet_amt * MINERAL_MATERIAL_AMOUNT))
sheet_amt = round(materials[M] / MINERAL_MATERIAL_AMOUNT)
if(materials[M] < (sheet_amt * SHEET_MATERIAL_AMOUNT))
sheet_amt = round(materials[M] / SHEET_MATERIAL_AMOUNT)
var/count = 0
while(sheet_amt > MAX_STACK_SIZE)
new M.sheet_type(target, MAX_STACK_SIZE, null, list((M) = MINERAL_MATERIAL_AMOUNT))
new M.sheet_type(target, MAX_STACK_SIZE, null, list((M) = SHEET_MATERIAL_AMOUNT))
count += MAX_STACK_SIZE
use_amount_mat(sheet_amt * MINERAL_MATERIAL_AMOUNT, M)
use_amount_mat(sheet_amt * SHEET_MATERIAL_AMOUNT, M)
sheet_amt -= MAX_STACK_SIZE
if(sheet_amt >= 1)
new M.sheet_type(target, sheet_amt, null, list((M) = MINERAL_MATERIAL_AMOUNT))
new M.sheet_type(target, sheet_amt, null, list((M) = SHEET_MATERIAL_AMOUNT))
count += sheet_amt
use_amount_mat(sheet_amt * MINERAL_MATERIAL_AMOUNT, M)
use_amount_mat(sheet_amt * SHEET_MATERIAL_AMOUNT, M)
return count


Expand Down Expand Up @@ -410,14 +410,14 @@

/// Turns a material amount into the amount of sheets it should output
/datum/component/material_container/proc/amount2sheet(amt)
if(amt >= MINERAL_MATERIAL_AMOUNT)
return round(amt / MINERAL_MATERIAL_AMOUNT)
if(amt >= SHEET_MATERIAL_AMOUNT)
return round(amt / SHEET_MATERIAL_AMOUNT)
return FALSE

/// Turns an amount of sheets into the amount of material amount it should output
/datum/component/material_container/proc/sheet2amount(sheet_amt)
if(sheet_amt > 0)
return sheet_amt * MINERAL_MATERIAL_AMOUNT
return sheet_amt * SHEET_MATERIAL_AMOUNT
return FALSE


Expand Down Expand Up @@ -450,8 +450,8 @@
"name" = material.name,
"ref" = REF(material),
"amount" = amount,
"sheets" = round(amount / MINERAL_MATERIAL_AMOUNT),
"removable" = amount >= MINERAL_MATERIAL_AMOUNT,
"sheets" = round(amount / SHEET_MATERIAL_AMOUNT),
"removable" = amount >= SHEET_MATERIAL_AMOUNT,
"color" = material.greyscale_colors
))

Expand Down
2 changes: 1 addition & 1 deletion code/datums/holocall.dm
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
desc = "Stores recorder holocalls."
icon_state = "holodisk"
obj_flags = UNIQUE_RENAME
custom_materials = list(/datum/material/iron = 100, /datum/material/glass = 100)
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT, /datum/material/glass = SMALL_MATERIAL_AMOUNT)
var/datum/holorecord/record
//Preset variables
var/preset_image_type
Expand Down
2 changes: 1 addition & 1 deletion code/datums/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ GLOBAL_LIST_INIT(huds, list(
DATA_HUD_SENTIENT_DISEASE = new/datum/atom_hud/sentient_disease(),
DATA_HUD_AI_DETECT = new/datum/atom_hud/ai_detector(),
DATA_HUD_FAN = new/datum/atom_hud/data/human/fan_hud(),
DATA_HUD_PERMIT = new/datum/atom_hud/data/human/permit()
DATA_HUD_PERMIT = new/datum/atom_hud/data/human/permit(), //monkestation edit
))

/datum/atom_hud
Expand Down
8 changes: 4 additions & 4 deletions code/datums/materials/alloys.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
if(!istype(target_item))
return

target_item.slowdown += MATERIAL_SLOWDOWN_PLASTEEL * amount / MINERAL_MATERIAL_AMOUNT
target_item.slowdown += MATERIAL_SLOWDOWN_PLASTEEL * amount / SHEET_MATERIAL_AMOUNT

/datum/material/alloy/plasteel/on_removed_obj(obj/item/target_item, amount, material_flags)
. = ..()

if(!istype(target_item))
return

target_item.slowdown -= MATERIAL_SLOWDOWN_PLASTEEL * amount / MINERAL_MATERIAL_AMOUNT
target_item.slowdown -= MATERIAL_SLOWDOWN_PLASTEEL * amount / SHEET_MATERIAL_AMOUNT

/** Plastitanium
*
Expand Down Expand Up @@ -163,7 +163,7 @@
if(!istype(target_item))
return

target_item.slowdown += MATERIAL_SLOWDOWN_ALIEN_ALLOY * amount / MINERAL_MATERIAL_AMOUNT
target_item.slowdown += MATERIAL_SLOWDOWN_ALIEN_ALLOY * amount / SHEET_MATERIAL_AMOUNT

/datum/material/alloy/alien/on_removed_obj(obj/item/target_item, amount, material_flags)
. = ..()
Expand All @@ -172,4 +172,4 @@
if(!istype(target_item))
return

target_item.slowdown -= MATERIAL_SLOWDOWN_ALIEN_ALLOY * amount / MINERAL_MATERIAL_AMOUNT
target_item.slowdown -= MATERIAL_SLOWDOWN_ALIEN_ALLOY * amount / SHEET_MATERIAL_AMOUNT
4 changes: 2 additions & 2 deletions code/datums/materials/meat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
make_edible(T, amount, material_flags)

/datum/material/meat/proc/make_edible(atom/source, amount, material_flags)
var/nutriment_count = 3 * (amount / MINERAL_MATERIAL_AMOUNT)
var/oil_count = 2 * (amount / MINERAL_MATERIAL_AMOUNT)
var/nutriment_count = 3 * (amount / SHEET_MATERIAL_AMOUNT)
var/oil_count = 2 * (amount / SHEET_MATERIAL_AMOUNT)
source.AddComponent(/datum/component/edible, \
initial_reagents = list(/datum/reagent/consumable/nutriment = nutriment_count, /datum/reagent/consumable/cooking_oil = oil_count), \
foodtypes = RAW | MEAT | GROSS, \
Expand Down
4 changes: 2 additions & 2 deletions code/datums/materials/pizza.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
make_edible(T, amount, material_flags)

/datum/material/pizza/proc/make_edible(atom/source, amount, material_flags)
var/nutriment_count = 3 * (amount / MINERAL_MATERIAL_AMOUNT)
var/oil_count = 2 * (amount / MINERAL_MATERIAL_AMOUNT)
var/nutriment_count = 3 * (amount / SHEET_MATERIAL_AMOUNT)
var/oil_count = 2 * (amount / SHEET_MATERIAL_AMOUNT)
source.AddComponent(/datum/component/edible, \
initial_reagents = list(/datum/reagent/consumable/nutriment = nutriment_count, /datum/reagent/consumable/cooking_oil = oil_count), \
foodtypes = GRAIN | MEAT | DAIRY | VEGETABLES, \
Expand Down
2 changes: 1 addition & 1 deletion code/datums/mutations/tongue_spike.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
)
w_class = WEIGHT_CLASS_SMALL
sharpness = SHARP_POINTY
custom_materials = list(/datum/material/biomass = 500)
custom_materials = list(/datum/material/biomass = SMALL_MATERIAL_AMOUNT * 5)
/// What mob "fired" our tongue
var/datum/weakref/fired_by_ref
/// if we missed our target
Expand Down
5 changes: 3 additions & 2 deletions code/game/data_huds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
hud_icons = list(ID_HUD)

/datum/atom_hud/data/human/security/advanced
hud_icons = list(ID_HUD, IMPTRACK_HUD, IMPLOYAL_HUD, IMPCHEM_HUD, WANTED_HUD, NANITE_HUD, PERMIT_HUD)
hud_icons = list(ID_HUD, IMPTRACK_HUD, IMPLOYAL_HUD, IMPCHEM_HUD, WANTED_HUD, NANITE_HUD, PERMIT_HUD) //monkestation edit: adds NANITE_HUD and PERMIT_HUD

/datum/atom_hud/data/human/fan_hud
hud_icons = list(FAN_HUD)
Expand Down Expand Up @@ -272,13 +272,14 @@ Security HUDs! Basic mode shows only the job.
sechud_icon_state = "hudno_id"
holder.icon_state = sechud_icon_state
sec_hud_set_security_status()

//monkestation edit start
var/image/permit_holder = hud_list[PERMIT_HUD]
permit_holder.pixel_y = I.Height() - world.icon_size
var/permit_icon_state = wear_id?.get_gun_permit_iconstate()
if(!permit_icon_state)
permit_icon_state = "hudfan_no"
permit_holder.icon_state = permit_icon_state
//monkestation edit end

/mob/living/proc/sec_hud_set_implants()
var/image/holder
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/autolathe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@

/obj/machinery/autolathe/proc/AfterMaterialInsert(obj/item/item_inserted, id_inserted, amount_inserted)
if(istype(item_inserted, /obj/item/stack/ore/bluespace_crystal))
use_power(MINERAL_MATERIAL_AMOUNT / 10)
use_power(SHEET_MATERIAL_AMOUNT / 10)
else if(item_inserted.has_material_type(/datum/material/glass))
flick("autolathe_r", src)//plays glass insertion animation by default otherwise
else
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/buttons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -354,5 +354,5 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/button/door, 24)
desc = "Used for building buttons."
icon_state = "button"
result_path = /obj/machinery/button
custom_materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT)
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT)
pixel_shift = 24
2 changes: 1 addition & 1 deletion code/game/machinery/camera/camera_assembly.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc = "The basic construction for Nanotrasen-Always-Watching-You cameras."
icon = 'icons/obj/machines/camera.dmi'
icon_state = "cameracase"
custom_materials = list(/datum/material/iron=400, /datum/material/glass=250)
custom_materials = list(/datum/material/iron=SMALL_MATERIAL_AMOUNT * 4, /datum/material/glass= SMALL_MATERIAL_AMOUNT * 2.5)
result_path = /obj/structure/camera_assembly
wall_external = TRUE

Expand Down
6 changes: 6 additions & 0 deletions code/game/machinery/cell_charger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
if(charging)
to_chat(user, span_warning("There is already a cell in the charger!"))
return
//MONKESTATION EDIT ADDITION
var/obj/item/stock_parts/cell/inserting_cell = W
if(inserting_cell.chargerate <= 0)
to_chat(user, span_warning("[inserting_cell] cannot be recharged!"))
return
//MONKESTATION EDIT END
else
var/area/a = loc.loc // Gets our locations location, like a dream within a dream
if(!isarea(a))
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/defibrillator_mount.dm
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/defibrillator_mount, 28)
desc = "A frame for a defibrillator mount. Once placed, it can be removed with a wrench."
icon = 'icons/obj/machines/defib_mount.dmi'
icon_state = "defibrillator_mount"
custom_materials = list(/datum/material/iron = 300, /datum/material/glass = 100)
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 3, /datum/material/glass = SMALL_MATERIAL_AMOUNT)
w_class = WEIGHT_CLASS_BULKY
result_path = /obj/machinery/defibrillator_mount
pixel_shift = 28
Expand All @@ -221,5 +221,5 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/defibrillator_mount, 28)
name = "unhooked PENLITE defibrillator mount"
desc = "A frame for a PENLITE defibrillator mount. Unlike the normal mount, it can passively recharge the unit inside."
icon_state = "penlite_mount"
custom_materials = list(/datum/material/iron = 300, /datum/material/glass = 100, /datum/material/silver = 50)
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 3, /datum/material/glass = SMALL_MATERIAL_AMOUNT, /datum/material/silver = SMALL_MATERIAL_AMOUNT * 0.5)
result_path = /obj/machinery/defibrillator_mount/charging
2 changes: 1 addition & 1 deletion code/game/machinery/doors/airlock_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
material_modifier = 0.25

/obj/machinery/door/airlock/plasma/Initialize(mapload)
custom_materials = custom_materials ? custom_materials : list(/datum/material/plasma = 20000)
custom_materials = custom_materials ? custom_materials : list(/datum/material/plasma = SHEET_MATERIAL_AMOUNT * 10)
. = ..()

/obj/machinery/door/airlock/plasma/block_superconductivity() //we don't stop the heat~
Expand Down
Loading

0 comments on commit 15e83b1

Please sign in to comment.