Ports /tg/ pr #44529, reverts #9092

This commit is contained in:
necromanceranne
2020-02-16 22:20:50 +11:00
parent d4072e3e1a
commit 5c2e244ee0
20 changed files with 378 additions and 35 deletions
+5 -5
View File
@@ -3,9 +3,9 @@
internal_damage_threshold = 50
armor = list("melee" = 30, "bullet" = 30, "laser" = 15, "energy" = 20, "bomb" = 20, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 100)
mouse_pointer = 'icons/mecha/mecha_mouse.dmi'
var/spawn_tracked = TRUE
/obj/mecha/combat/Initialize()
. = ..()
if(spawn_tracked)
trackers += new /obj/item/mecha_parts/mecha_tracking(src)
/obj/mecha/combat/proc/max_ammo() //Max the ammo stored for Nuke Ops mechs, or anyone else that calls this
for(var/obj/item/I in equipment)
if(istype(I, /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/))
var/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/gun = I
gun.projectiles_cache = gun.projectiles_cache_max
+1 -1
View File
@@ -30,7 +30,6 @@
internals_req_access = list(ACCESS_SYNDICATE)
wreckage = /obj/structure/mecha_wreckage/gygax/dark
max_equip = 4
spawn_tracked = FALSE
/obj/mecha/combat/gygax/dark/loaded/Initialize()
. = ..()
@@ -42,6 +41,7 @@
ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/tesla_energy_relay
ME.attach(src)
max_ammo()
/obj/mecha/combat/gygax/dark/add_cell(obj/item/stock_parts/cell/C=null)
if(C)
+3 -1
View File
@@ -17,7 +17,6 @@
force = 45
max_equip = 4
bumpsmash = 1
spawn_tracked = FALSE
/obj/mecha/combat/marauder/GrantActions(mob/living/user, human_occupant = 0)
..()
@@ -41,6 +40,7 @@
ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster(src)
ME.attach(src)
max_ammo()
/obj/mecha/combat/marauder/seraph
desc = "Heavy-duty, command-type exosuit. This is a custom model, utilized only by high-ranking military personnel."
@@ -68,6 +68,7 @@
ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster(src)
ME.attach(src)
max_ammo()
/obj/mecha/combat/marauder/mauler
desc = "Heavy-duty, combat exosuit, developed off of the existing Marauder model."
@@ -90,5 +91,6 @@
ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster(src)
ME.attach(src)
max_ammo()
-1
View File
@@ -15,7 +15,6 @@
internals_req_access = list()
add_req_access = 0
wreckage = /obj/structure/mecha_wreckage/durand/neovgre
spawn_tracked = FALSE
/obj/mecha/combat/neovgre/GrantActions(mob/living/user, human_occupant = 0) //No Eject action for you sonny jim, your life for Ratvar!
internals_action.Grant(user, src)
-1
View File
@@ -19,7 +19,6 @@
stepsound = null
turnsound = null
opacity = 0
spawn_tracked = FALSE
/obj/mecha/combat/reticence/loaded/Initialize()
. = ..()
@@ -34,6 +34,19 @@
return
if(!cargo_holder)
return
if(ismecha(target))
var/obj/mecha/M = target
var/have_ammo
for(var/obj/item/mecha_ammo/box in cargo_holder.cargo)
if(istype(box, /obj/item/mecha_ammo) && box.rounds)
have_ammo = TRUE
if(M.ammo_resupply(box, chassis.occupant, TRUE))
return
if(have_ammo)
to_chat(chassis.occupant, "No further supplies can be provided to [M].")
else
to_chat(chassis.occupant, "No providable supplies found in cargo hold")
return
if(isobj(target))
var/obj/O = target
if(!O.anchored)
@@ -0,0 +1,94 @@
/obj/item/mecha_ammo
name = "generic ammo box"
desc = "A box of ammo for an unknown weapon."
w_class = WEIGHT_CLASS_BULKY
icon = 'icons/mecha/mecha_ammo.dmi'
icon_state = "empty"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
var/rounds = 0
var/round_term = "round"
var/direct_load //For weapons where we re-load the weapon itself rather than adding to the ammo storage.
var/load_audio = "sound/weapons/gun_magazine_insert_empty_1.ogg"
var/ammo_type
/obj/item/mecha_ammo/proc/update_name()
if(!rounds)
name = "empty ammo box"
desc = "An exosuit ammuniton box that has since been emptied. Please recycle."
icon_state = "empty"
/obj/item/mecha_ammo/attack_self(mob/user)
..()
if(rounds)
to_chat(user, "<span class='warning'>You cannot flatten the ammo box until it's empty!</span>")
return
to_chat(user, "<span class='notice'>You fold [src] flat.</span>")
var/I = new /obj/item/stack/sheet/metal(user.loc)
qdel(src)
user.put_in_hands(I)
/obj/item/mecha_ammo/examine(mob/user)
. = ..()
if(rounds)
. += "There [rounds > 1?"are":"is"] [rounds] [round_term][rounds > 1?"s":""] left."
/obj/item/mecha_ammo/incendiary
name = "incendiary ammo"
desc = "A box of incendiary ammunition for use with exosuit weapons."
icon_state = "incendiary"
rounds = 24
ammo_type = "incendiary"
/obj/item/mecha_ammo/scattershot
name = "scattershot ammo"
desc = "A box of scaled-up buckshot, for use in exosuit shotguns."
icon_state = "scattershot"
rounds = 40
ammo_type = "scattershot"
/obj/item/mecha_ammo/lmg
name = "machine gun ammo"
desc = "A box of linked ammunition, designed for the Ultra AC 2 exosuit weapon."
icon_state = "lmg"
rounds = 300
ammo_type = "lmg"
/obj/item/mecha_ammo/missiles_br
name = "breaching missiles"
desc = "A box of large missiles, ready for loading into a BRM-6 exosuit missile rack."
icon_state = "missile_br"
rounds = 6
round_term = "missile"
direct_load = TRUE
load_audio = "sound/weapons/bulletinsert.ogg"
ammo_type = "missiles_br"
/obj/item/mecha_ammo/missiles_he
name = "anti-armor missiles"
desc = "A box of large missiles, ready for loading into an SRM-8 exosuit missile rack."
icon_state = "missile_he"
rounds = 8
round_term = "missile"
direct_load = TRUE
load_audio = "sound/weapons/bulletinsert.ogg"
ammo_type = "missiles_he"
/obj/item/mecha_ammo/flashbang
name = "launchable flashbangs"
desc = "A box of smooth flashbangs, for use with a large exosuit launcher. Cannot be primed by hand."
icon_state = "flashbang"
rounds = 6
round_term = "grenade"
ammo_type = "flashbang"
/obj/item/mecha_ammo/clusterbang
name = "launchable flashbang clusters"
desc = "A box of clustered flashbangs, for use with a specialized exosuit cluster launcher. Cannot be primed by hand."
icon_state = "clusterbang"
rounds = 3
round_term = "cluster"
direct_load = TRUE
ammo_type = "clusterbang"
+60 -15
View File
@@ -196,7 +196,11 @@
name = "general ballistic weapon"
fire_sound = 'sound/weapons/gunshot.ogg'
var/projectiles
var/projectiles_cache //ammo to be loaded in, if possible.
var/projectiles_cache_max
var/projectile_energy_cost
var/disabledreload //For weapons with no cache (like the rockets) which are reloaded by hand
var/ammo_type
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/get_shot_amount()
return min(projectiles, projectiles_per_shot)
@@ -209,19 +213,32 @@
return 1
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/get_equip_info()
return "[..()] \[[src.projectiles]\][(src.projectiles < initial(src.projectiles))?" - <a href='?src=[REF(src)];rearm=1'>Rearm</a>":null]"
return "[..()] \[[src.projectiles][projectiles_cache_max &&!projectile_energy_cost?"/[projectiles_cache]":""]\][!disabledreload &&(src.projectiles < initial(src.projectiles))?" - <a href='?src=[REF(src)];rearm=1'>Rearm</a>":null]"
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/rearm()
if(projectiles < initial(projectiles))
var/projectiles_to_add = initial(projectiles) - projectiles
while(chassis.get_charge() >= projectile_energy_cost && projectiles_to_add)
projectiles++
projectiles_to_add--
chassis.use_power(projectile_energy_cost)
send_byjax(chassis.occupant,"exosuit.browser","[REF(src)]",src.get_equip_info())
mecha_log_message("Rearmed [src.name].")
return 1
if(projectile_energy_cost)
while(chassis.get_charge() >= projectile_energy_cost && projectiles_to_add)
projectiles++
projectiles_to_add--
chassis.use_power(projectile_energy_cost)
else
if(!projectiles_cache)
return FALSE
if(projectiles_to_add <= projectiles_cache)
projectiles = projectiles + projectiles_to_add
projectiles_cache = projectiles_cache - projectiles_to_add
else
projectiles = projectiles + projectiles_cache
projectiles_cache = 0
send_byjax(chassis.occupant,"exosuit.browser","[REF(src)]",src.get_equip_info())
log_message("Rearmed [src.name].", LOG_MECHA)
return TRUE
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/needs_rearm()
@@ -249,8 +266,10 @@
equip_cooldown = 10
projectile = /obj/item/projectile/bullet/incendiary/fnx99
projectiles = 24
projectile_energy_cost = 15
projectiles_cache = 24
projectiles_cache_max = 96
harmful = TRUE
ammo_type = "incendiary"
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/silenced
name = "\improper S.H.H. \"Quietus\" Carbine"
@@ -270,10 +289,12 @@
equip_cooldown = 20
projectile = /obj/item/projectile/bullet/scattershot
projectiles = 40
projectile_energy_cost = 25
projectiles_cache = 40
projectiles_cache_max = 160
projectiles_per_shot = 4
variance = 25
harmful = TRUE
ammo_type = "scattershot"
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/seedscatter
name = "\improper Melon Seed \"Scattershot\""
@@ -294,23 +315,42 @@
equip_cooldown = 10
projectile = /obj/item/projectile/bullet/lmg
projectiles = 300
projectile_energy_cost = 20
projectiles_cache = 300
projectiles_cache_max = 1200
projectiles_per_shot = 3
variance = 6
randomspread = 1
projectile_delay = 2
harmful = TRUE
ammo_type = "lmg"
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack
name = "\improper SRM-8 missile rack"
desc = "A weapon for combat exosuits. Shoots light explosive missiles."
desc = "A weapon for combat exosuits. Launches light explosive missiles."
icon_state = "mecha_missilerack"
projectile = /obj/item/projectile/bullet/a84mm_he
fire_sound = 'sound/weapons/grenadelaunch.ogg'
projectiles = 8
projectile_energy_cost = 1000
projectiles_cache = 0
projectiles_cache_max = 0
disabledreload = TRUE
equip_cooldown = 60
harmful = TRUE
ammo_type = "missiles_he"
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/breaching
name = "\improper BRM-6 missile rack"
desc = "A weapon for combat exosuits. Launches low-explosive breaching missiles designed to explode only when striking a sturdy target."
icon_state = "mecha_missilerack_six"
projectile = /obj/item/projectile/bullet/a84mm_br
fire_sound = 'sound/weapons/grenadelaunch.ogg'
projectiles = 6
projectiles_cache = 0
projectiles_cache_max = 0
disabledreload = TRUE
equip_cooldown = 60
harmful = TRUE
ammo_type = "missiles_br"
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher
@@ -341,10 +381,12 @@
projectile = /obj/item/grenade/flashbang
fire_sound = 'sound/weapons/grenadelaunch.ogg'
projectiles = 6
projectiles_cache = 6
projectiles_cache_max = 24
missile_speed = 1.5
projectile_energy_cost = 800
equip_cooldown = 60
var/det_time = 20
ammo_type = "flashbang"
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/flashbang/proj_init(var/obj/item/grenade/flashbang/F)
var/turf/T = get_turf(src)
@@ -356,9 +398,12 @@
name = "\improper SOB-3 grenade launcher"
desc = "A weapon for combat exosuits. Launches primed clusterbangs. You monster."
projectiles = 3
projectiles_cache = 0
projectiles_cache_max = 0
disabledreload = TRUE
projectile = /obj/item/grenade/clusterbuster
projectile_energy_cost = 1600 //getting off cheap seeing as this is 3 times the flashbangs held in the grenade launcher.
equip_cooldown = 90
ammo_type = "clusterbang"
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/banana_mortar
name = "banana mortar"
+1
View File
@@ -29,6 +29,7 @@
"H.O.N.K",
"Phazon",
"Exosuit Equipment",
"Exosuit Ammunition",
"Cyborg Upgrade Modules",
"Misc"
)
+50
View File
@@ -1070,3 +1070,53 @@
if(occupant_sight_flags)
if(user == occupant)
user.sight |= occupant_sight_flags
///////////////////////
////// Ammo stuff /////
///////////////////////
/obj/mecha/proc/ammo_resupply(var/obj/item/mecha_ammo/A, mob/user,var/fail_chat_override = FALSE)
if(!A.rounds)
if(!fail_chat_override)
to_chat(user, "<span class='warning'>This box of ammo is empty!</span>")
return FALSE
var/ammo_needed
var/found_gun
for(var/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/gun in equipment)
ammo_needed = 0
if(istype(gun, /obj/item/mecha_parts/mecha_equipment/weapon/ballistic) && gun.ammo_type == A.ammo_type)
found_gun = TRUE
if(A.direct_load)
ammo_needed = initial(gun.projectiles) - gun.projectiles
else
ammo_needed = gun.projectiles_cache_max - gun.projectiles_cache
if(ammo_needed)
if(ammo_needed < A.rounds)
if(A.direct_load)
gun.projectiles = gun.projectiles + ammo_needed
else
gun.projectiles_cache = gun.projectiles_cache + ammo_needed
playsound(get_turf(user),A.load_audio,50,1)
to_chat(user, "<span class='notice'>You add [ammo_needed] [A.round_term][ammo_needed > 1?"s":""] to the [gun.name]</span>")
A.rounds = A.rounds - ammo_needed
A.update_name()
return TRUE
else
if(A.direct_load)
gun.projectiles = gun.projectiles + A.rounds
else
gun.projectiles_cache = gun.projectiles_cache + A.rounds
playsound(get_turf(user),A.load_audio,50,1)
to_chat(user, "<span class='notice'>You add [A.rounds] [A.round_term][A.rounds > 1?"s":""] to the [gun.name]</span>")
A.rounds = 0
A.update_name()
return TRUE
if(!fail_chat_override)
if(found_gun)
to_chat(user, "<span class='notice'>You can't fit any more ammo of this type!</span>")
else
to_chat(user, "<span class='notice'>None of the equipment on this exosuit can use this ammo!</span>")
return FALSE
+4
View File
@@ -172,6 +172,10 @@
to_chat(user, "[src]-[W] interface initialization failed.")
return
if(istype(W, /obj/item/mecha_ammo))
ammo_resupply(W, user)
return
if(istype(W, /obj/item/mecha_parts/mecha_equipment))
var/obj/item/mecha_parts/mecha_equipment/E = W
spawn()
@@ -528,6 +528,31 @@
for(var/i in 1 to 9)
new /obj/item/ammo_box/magazine/smgm45(src)
/obj/item/storage/backpack/duffelbag/syndie/ammo/dark_gygax
desc = "A large duffel bag, packed to the brim with various exosuit ammo."
/obj/item/storage/backpack/duffelbag/syndie/ammo/dark_gygax/PopulateContents()
new /obj/item/mecha_ammo/incendiary(src)
new /obj/item/mecha_ammo/incendiary(src)
new /obj/item/mecha_ammo/incendiary(src)
new /obj/item/mecha_ammo/flashbang(src)
new /obj/item/mecha_ammo/flashbang(src)
new /obj/item/mecha_ammo/flashbang(src)
/obj/item/storage/backpack/duffelbag/syndie/ammo/mauler
desc = "A large duffel bag, packed to the brim with various exosuit ammo."
/obj/item/storage/backpack/duffelbag/syndie/ammo/mauler/PopulateContents()
new /obj/item/mecha_ammo/lmg(src)
new /obj/item/mecha_ammo/lmg(src)
new /obj/item/mecha_ammo/lmg(src)
new /obj/item/mecha_ammo/scattershot(src)
new /obj/item/mecha_ammo/scattershot(src)
new /obj/item/mecha_ammo/scattershot(src)
new /obj/item/mecha_ammo/missiles_he(src)
new /obj/item/mecha_ammo/missiles_he(src)
new /obj/item/mecha_ammo/missiles_he(src)
/obj/item/storage/backpack/duffelbag/syndie/c20rbundle
desc = "A large duffel bag containing a C-20r, some magazines, and a cheap looking suppressor."