@@ -1,158 +1,158 @@
|
||||
//DO NOT ADD MECHA PARTS TO THE GAME WITH THE DEFAULT "SPRITE ME" SPRITE!
|
||||
//I'm annoyed I even have to tell you this! SPRITE FIRST, then commit.
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment
|
||||
name = "mecha equipment"
|
||||
icon = 'icons/mecha/mecha_equipment.dmi'
|
||||
icon_state = "mecha_equip"
|
||||
force = 5
|
||||
origin_tech = "materials=2;engineering=2"
|
||||
obj_integrity = 300
|
||||
max_integrity = 300
|
||||
var/equip_cooldown = 0 // cooldown after use
|
||||
var/equip_ready = 1 //whether the equipment is ready for use. (or deactivated/activated for static stuff)
|
||||
var/energy_drain = 0
|
||||
var/obj/mecha/chassis = null
|
||||
var/range = MELEE //bitflags
|
||||
var/salvageable = 1
|
||||
var/selectable = 1 // Set to 0 for passive equipment such as mining scanner or armor plates
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/update_chassis_page()
|
||||
if(chassis)
|
||||
send_byjax(chassis.occupant,"exosuit.browser","eq_list",chassis.get_equipment_list())
|
||||
send_byjax(chassis.occupant,"exosuit.browser","equipment_menu",chassis.get_equipment_menu(),"dropdowns")
|
||||
return 1
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/update_equip_info()
|
||||
if(chassis)
|
||||
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",get_equip_info())
|
||||
return 1
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/Destroy()
|
||||
if(chassis)
|
||||
chassis.equipment -= src
|
||||
if(chassis.selected == src)
|
||||
chassis.selected = null
|
||||
src.update_chassis_page()
|
||||
chassis.occupant_message("<span class='danger'>The [src] is destroyed!</span>")
|
||||
chassis.log_append_to_last("[src] is destroyed.",1)
|
||||
if(istype(src, /obj/item/mecha_parts/mecha_equipment/weapon))
|
||||
chassis.occupant << sound('sound/mecha/weapdestr.ogg',volume=50)
|
||||
else
|
||||
chassis.occupant << sound('sound/mecha/critdestr.ogg',volume=50)
|
||||
chassis = null
|
||||
return ..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/critfail()
|
||||
if(chassis)
|
||||
log_message("Critical failure",1)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/get_equip_info()
|
||||
if(!chassis) return
|
||||
var/txt = "<span style=\"color:[equip_ready?"#0f0":"#f00"];\">*</span> "
|
||||
if(chassis.selected == src)
|
||||
txt += "<b>[src.name]</b>"
|
||||
else if(selectable)
|
||||
txt += "<a href='?src=\ref[chassis];select_equip=\ref[src]'>[src.name]</a>"
|
||||
else
|
||||
txt += "[src.name]"
|
||||
|
||||
return txt
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/is_ranged()//add a distance restricted equipment. Why not?
|
||||
return range&RANGED
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/is_melee()
|
||||
return range&MELEE
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/action_checks(atom/target)
|
||||
if(!target)
|
||||
return 0
|
||||
if(!chassis)
|
||||
return 0
|
||||
if(!equip_ready)
|
||||
return 0
|
||||
if(crit_fail)
|
||||
return 0
|
||||
if(energy_drain && !chassis.has_charge(energy_drain))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/action(atom/target)
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/start_cooldown()
|
||||
set_ready_state(0)
|
||||
chassis.use_power(energy_drain)
|
||||
addtimer(CALLBACK(src, .proc/set_ready_state, 1), equip_cooldown)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/do_after_cooldown(atom/target)
|
||||
if(!chassis)
|
||||
return
|
||||
var/C = chassis.loc
|
||||
set_ready_state(0)
|
||||
chassis.use_power(energy_drain)
|
||||
. = do_after(chassis.occupant, equip_cooldown, target=target)
|
||||
set_ready_state(1)
|
||||
if(!chassis || chassis.loc != C || src != chassis.selected)
|
||||
return 0
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/can_attach(obj/mecha/M)
|
||||
if(M.equipment.len<M.max_equip)
|
||||
return 1
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/attach(obj/mecha/M)
|
||||
M.equipment += src
|
||||
chassis = M
|
||||
src.loc = M
|
||||
M.log_message("[src] initialized.")
|
||||
if(!M.selected && selectable)
|
||||
M.selected = src
|
||||
src.update_chassis_page()
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/detach(atom/moveto=null)
|
||||
moveto = moveto || get_turf(chassis)
|
||||
if(src.Move(moveto))
|
||||
chassis.equipment -= src
|
||||
if(chassis.selected == src)
|
||||
chassis.selected = null
|
||||
update_chassis_page()
|
||||
chassis.log_message("[src] removed from equipment.")
|
||||
chassis = null
|
||||
set_ready_state(1)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/Topic(href,href_list)
|
||||
if(href_list["detach"])
|
||||
detach()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/set_ready_state(state)
|
||||
equip_ready = state
|
||||
if(chassis)
|
||||
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/occupant_message(message)
|
||||
if(chassis)
|
||||
//DO NOT ADD MECHA PARTS TO THE GAME WITH THE DEFAULT "SPRITE ME" SPRITE!
|
||||
//I'm annoyed I even have to tell you this! SPRITE FIRST, then commit.
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment
|
||||
name = "mecha equipment"
|
||||
icon = 'icons/mecha/mecha_equipment.dmi'
|
||||
icon_state = "mecha_equip"
|
||||
force = 5
|
||||
origin_tech = "materials=2;engineering=2"
|
||||
obj_integrity = 300
|
||||
max_integrity = 300
|
||||
var/equip_cooldown = 0 // cooldown after use
|
||||
var/equip_ready = 1 //whether the equipment is ready for use. (or deactivated/activated for static stuff)
|
||||
var/energy_drain = 0
|
||||
var/obj/mecha/chassis = null
|
||||
var/range = MELEE //bitflags
|
||||
var/salvageable = 1
|
||||
var/selectable = 1 // Set to 0 for passive equipment such as mining scanner or armor plates
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/update_chassis_page()
|
||||
if(chassis)
|
||||
send_byjax(chassis.occupant,"exosuit.browser","eq_list",chassis.get_equipment_list())
|
||||
send_byjax(chassis.occupant,"exosuit.browser","equipment_menu",chassis.get_equipment_menu(),"dropdowns")
|
||||
return 1
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/update_equip_info()
|
||||
if(chassis)
|
||||
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",get_equip_info())
|
||||
return 1
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/Destroy()
|
||||
if(chassis)
|
||||
chassis.equipment -= src
|
||||
if(chassis.selected == src)
|
||||
chassis.selected = null
|
||||
src.update_chassis_page()
|
||||
chassis.occupant_message("<span class='danger'>The [src] is destroyed!</span>")
|
||||
chassis.log_append_to_last("[src] is destroyed.",1)
|
||||
if(istype(src, /obj/item/mecha_parts/mecha_equipment/weapon))
|
||||
chassis.occupant << sound('sound/mecha/weapdestr.ogg',volume=50)
|
||||
else
|
||||
chassis.occupant << sound('sound/mecha/critdestr.ogg',volume=50)
|
||||
chassis = null
|
||||
return ..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/critfail()
|
||||
if(chassis)
|
||||
log_message("Critical failure",1)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/get_equip_info()
|
||||
if(!chassis) return
|
||||
var/txt = "<span style=\"color:[equip_ready?"#0f0":"#f00"];\">*</span> "
|
||||
if(chassis.selected == src)
|
||||
txt += "<b>[src.name]</b>"
|
||||
else if(selectable)
|
||||
txt += "<a href='?src=\ref[chassis];select_equip=\ref[src]'>[src.name]</a>"
|
||||
else
|
||||
txt += "[src.name]"
|
||||
|
||||
return txt
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/is_ranged()//add a distance restricted equipment. Why not?
|
||||
return range&RANGED
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/is_melee()
|
||||
return range&MELEE
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/action_checks(atom/target)
|
||||
if(!target)
|
||||
return 0
|
||||
if(!chassis)
|
||||
return 0
|
||||
if(!equip_ready)
|
||||
return 0
|
||||
if(crit_fail)
|
||||
return 0
|
||||
if(energy_drain && !chassis.has_charge(energy_drain))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/action(atom/target)
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/start_cooldown()
|
||||
set_ready_state(0)
|
||||
chassis.use_power(energy_drain)
|
||||
addtimer(CALLBACK(src, .proc/set_ready_state, 1), equip_cooldown)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/do_after_cooldown(atom/target)
|
||||
if(!chassis)
|
||||
return
|
||||
var/C = chassis.loc
|
||||
set_ready_state(0)
|
||||
chassis.use_power(energy_drain)
|
||||
. = do_after(chassis.occupant, equip_cooldown, target=target)
|
||||
set_ready_state(1)
|
||||
if(!chassis || chassis.loc != C || src != chassis.selected)
|
||||
return 0
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/can_attach(obj/mecha/M)
|
||||
if(M.equipment.len<M.max_equip)
|
||||
return 1
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/attach(obj/mecha/M)
|
||||
M.equipment += src
|
||||
chassis = M
|
||||
src.loc = M
|
||||
M.log_message("[src] initialized.")
|
||||
if(!M.selected && selectable)
|
||||
M.selected = src
|
||||
src.update_chassis_page()
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/detach(atom/moveto=null)
|
||||
moveto = moveto || get_turf(chassis)
|
||||
if(src.Move(moveto))
|
||||
chassis.equipment -= src
|
||||
if(chassis.selected == src)
|
||||
chassis.selected = null
|
||||
update_chassis_page()
|
||||
chassis.log_message("[src] removed from equipment.")
|
||||
chassis = null
|
||||
set_ready_state(1)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/Topic(href,href_list)
|
||||
if(href_list["detach"])
|
||||
detach()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/set_ready_state(state)
|
||||
equip_ready = state
|
||||
if(chassis)
|
||||
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/occupant_message(message)
|
||||
if(chassis)
|
||||
chassis.occupant_message("[bicon(src)] [message]")
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/log_message(message)
|
||||
if(chassis)
|
||||
chassis.log_message("<i>[src]:</i> [message]")
|
||||
return
|
||||
|
||||
|
||||
//Used for reloading weapons/tools etc. that use some form of resource
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/rearm()
|
||||
return 0
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/needs_rearm()
|
||||
return 0
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/log_message(message)
|
||||
if(chassis)
|
||||
chassis.log_message("<i>[src]:</i> [message]")
|
||||
return
|
||||
|
||||
|
||||
//Used for reloading weapons/tools etc. that use some form of resource
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/rearm()
|
||||
return 0
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/needs_rearm()
|
||||
return 0
|
||||
|
||||
@@ -229,10 +229,9 @@
|
||||
return
|
||||
if(M.health > 0)
|
||||
M.adjustOxyLoss(-1)
|
||||
M.updatehealth()
|
||||
M.AdjustStunned(-4)
|
||||
M.AdjustWeakened(-4)
|
||||
M.AdjustStunned(-4)
|
||||
M.AdjustStun(-80)
|
||||
M.AdjustKnockdown(-80)
|
||||
M.AdjustUnconscious(-80)
|
||||
if(M.reagents.get_reagent_amount("epinephrine") < 5)
|
||||
M.reagents.add_reagent("epinephrine", 5)
|
||||
chassis.use_power(energy_drain)
|
||||
@@ -483,7 +482,7 @@
|
||||
if(get_dist(src,A) >= 4)
|
||||
occupant_message("The object is too far away.")
|
||||
return 0
|
||||
if(!A.reagents || istype(A,/mob))
|
||||
if(!A.reagents || ismob(A))
|
||||
occupant_message("<span class=\"alert\">No reagent info gained from [A].</span>")
|
||||
return 0
|
||||
occupant_message("Analyzing reagents...")
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
target.take_bodypart_damage(drill_damage)
|
||||
|
||||
if(target)
|
||||
target.Paralyse(10)
|
||||
target.Unconscious(200)
|
||||
target.updatehealth()
|
||||
|
||||
|
||||
|
||||
@@ -57,18 +57,12 @@
|
||||
var/turf/target_turf = pick(L)
|
||||
if(!target_turf)
|
||||
return
|
||||
var/obj/effect/portal/P = new /obj/effect/portal(get_turf(target))
|
||||
P.target = target_turf
|
||||
P.creator = null
|
||||
P.icon = 'icons/obj/objects.dmi'
|
||||
P.icon_state = "anom"
|
||||
P.name = "wormhole"
|
||||
P.mech_sized = TRUE
|
||||
var/list/obj/effect/portal/created = create_portal_pair(get_turf(src), target_turf, src, 300, 1, /obj/effect/portal/anom)
|
||||
var/turf/T = get_turf(target)
|
||||
message_admins("[ADMIN_LOOKUPFLW(chassis.occupant)] used a Wormhole Generator in [ADMIN_COORDJMP(T)]",0,1)
|
||||
log_game("[key_name(chassis.occupant)] used a Wormhole Generator in [COORD(T)]")
|
||||
src = null
|
||||
QDEL_IN(P, rand(150,300))
|
||||
QDEL_LIST_IN(created, rand(150,300))
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
@@ -224,34 +224,34 @@
|
||||
if(do_after_cooldown(W))
|
||||
chassis.spark_system.start()
|
||||
W.ChangeTurf(/turf/open/floor/plating)
|
||||
playsound(W, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(W, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
else if(isfloorturf(target))
|
||||
var/turf/open/floor/F = target
|
||||
occupant_message("Deconstructing [F]...")
|
||||
if(do_after_cooldown(target))
|
||||
chassis.spark_system.start()
|
||||
F.ChangeTurf(F.baseturf)
|
||||
playsound(F, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(F, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
else if (istype(target, /obj/machinery/door/airlock))
|
||||
occupant_message("Deconstructing [target]...")
|
||||
if(do_after_cooldown(target))
|
||||
chassis.spark_system.start()
|
||||
qdel(target)
|
||||
playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(target, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
if(1)
|
||||
if(isspaceturf(target))
|
||||
var/turf/open/space/S = target
|
||||
occupant_message("Building Floor...")
|
||||
if(do_after_cooldown(S))
|
||||
S.ChangeTurf(/turf/open/floor/plating)
|
||||
playsound(S, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(S, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
chassis.spark_system.start()
|
||||
else if(isfloorturf(target))
|
||||
var/turf/open/floor/F = target
|
||||
occupant_message("Building Wall...")
|
||||
if(do_after_cooldown(F))
|
||||
F.ChangeTurf(/turf/closed/wall)
|
||||
playsound(F, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(F, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
chassis.spark_system.start()
|
||||
if(2)
|
||||
if(isfloorturf(target))
|
||||
@@ -260,7 +260,7 @@
|
||||
chassis.spark_system.start()
|
||||
var/obj/machinery/door/airlock/T = new /obj/machinery/door/airlock(target)
|
||||
T.autoclose = 1
|
||||
playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(target, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
playsound(target, 'sound/effects/sparks2.ogg', 50, 1)
|
||||
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
origin_tech = "magnets=3;combat=3;engineering=3"
|
||||
energy_drain = 30
|
||||
projectile = /obj/item/projectile/beam/laser
|
||||
fire_sound = 'sound/weapons/Laser.ogg'
|
||||
fire_sound = 'sound/weapons/laser.ogg'
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/energy/laser/heavy
|
||||
equip_cooldown = 15
|
||||
@@ -98,7 +98,7 @@
|
||||
origin_tech = "materials=4;combat=5;magnets=4"
|
||||
energy_drain = 120
|
||||
projectile = /obj/item/projectile/ion
|
||||
fire_sound = 'sound/weapons/Laser.ogg'
|
||||
fire_sound = 'sound/weapons/laser.ogg'
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/energy/tesla
|
||||
equip_cooldown = 35
|
||||
@@ -147,7 +147,7 @@
|
||||
energy_drain = 20
|
||||
equip_cooldown = 8
|
||||
projectile = /obj/item/projectile/energy/electrode
|
||||
fire_sound = 'sound/weapons/Taser.ogg'
|
||||
fire_sound = 'sound/weapons/taser.ogg'
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/honker
|
||||
@@ -167,7 +167,7 @@
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/honker/action(target, params)
|
||||
if(!action_checks(target))
|
||||
return
|
||||
playsound(chassis, 'sound/items/AirHorn.ogg', 100, 1)
|
||||
playsound(chassis, 'sound/items/airhorn.ogg', 100, 1)
|
||||
chassis.occupant_message("<font color='red' size='5'>HONK</font>")
|
||||
for(var/mob/living/carbon/M in ohearers(6, chassis))
|
||||
if(ishuman(M))
|
||||
@@ -178,10 +178,10 @@
|
||||
M.SetSleeping(0)
|
||||
M.stuttering += 20
|
||||
M.adjustEarDamage(0, 30)
|
||||
M.Weaken(3)
|
||||
M.Knockdown(60)
|
||||
if(prob(30))
|
||||
M.Stun(10)
|
||||
M.Paralyse(4)
|
||||
M.Stun(200)
|
||||
M.Unconscious(80)
|
||||
else
|
||||
M.Jitter(500)
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
//Base ballistic weapon type
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic
|
||||
name = "general ballisic weapon"
|
||||
fire_sound = 'sound/weapons/Gunshot.ogg'
|
||||
fire_sound = 'sound/weapons/gunshot.ogg'
|
||||
var/projectiles
|
||||
var/projectile_energy_cost
|
||||
|
||||
@@ -256,7 +256,7 @@
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/silenced
|
||||
name = "\improper S.H.H. \"Quietus\" Carbine"
|
||||
desc = "A weapon for combat exosuits. A mime invention, field tests have shown that targets cannot even scream before going down."
|
||||
fire_sound = 'sound/weapons/Gunshot_silenced.ogg'
|
||||
fire_sound = 'sound/weapons/gunshot_silenced.ogg'
|
||||
icon_state = "mecha_mime"
|
||||
equip_cooldown = 30
|
||||
projectile = /obj/item/projectile/bullet/mime
|
||||
@@ -428,7 +428,7 @@
|
||||
|
||||
/obj/item/punching_glove/throw_impact(atom/hit_atom)
|
||||
if(!..())
|
||||
if(istype(hit_atom, /atom/movable))
|
||||
if(ismovableatom(hit_atom))
|
||||
var/atom/movable/AM = hit_atom
|
||||
AM.throw_at(get_edge_target_turf(AM,get_dir(src, AM)), 7, 2)
|
||||
qdel(src)
|
||||
|
||||
+503
-503
File diff suppressed because it is too large
Load Diff
+1051
-1052
File diff suppressed because it is too large
Load Diff
@@ -21,7 +21,7 @@
|
||||
|
||||
|
||||
/datum/action/innate/mecha
|
||||
check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUNNED | AB_CHECK_CONSCIOUS
|
||||
check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUN | AB_CHECK_CONSCIOUS
|
||||
var/obj/mecha/chassis
|
||||
|
||||
/datum/action/innate/mecha/Grant(mob/living/L, obj/mecha/M)
|
||||
|
||||
+1689
-1689
File diff suppressed because it is too large
Load Diff
+249
-249
@@ -1,250 +1,250 @@
|
||||
///////////////////////////////////
|
||||
//////// Mecha wreckage ////////
|
||||
///////////////////////////////////
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage
|
||||
name = "exosuit wreckage"
|
||||
desc = "Remains of some unfortunate mecha. Completely unrepairable, but perhaps something can be salvaged."
|
||||
icon = 'icons/mecha/mecha.dmi'
|
||||
density = 1
|
||||
anchored = 0
|
||||
opacity = 0
|
||||
var/list/welder_salvage = list(/obj/item/stack/sheet/plasteel,/obj/item/stack/sheet/metal,/obj/item/stack/rods)
|
||||
var/list/wirecutters_salvage = list(/obj/item/stack/cable_coil)
|
||||
var/list/crowbar_salvage = list()
|
||||
var/salvage_num = 5
|
||||
var/mob/living/silicon/ai/AI //AIs to be salvaged
|
||||
|
||||
/obj/structure/mecha_wreckage/New(loc, mob/living/silicon/ai/AI_pilot)
|
||||
..()
|
||||
if(AI_pilot) //Type-checking for this is already done in mecha/Destroy()
|
||||
AI = AI_pilot
|
||||
AI.apply_damage(150, BURN) //Give the AI a bit of damage from the "shock" of being suddenly shut down
|
||||
AI.death() //The damage is not enough to kill the AI, but to be 'corrupted files' in need of repair.
|
||||
AI.forceMove(src) //Put the dead AI inside the wreckage for recovery
|
||||
///////////////////////////////////
|
||||
//////// Mecha wreckage ////////
|
||||
///////////////////////////////////
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage
|
||||
name = "exosuit wreckage"
|
||||
desc = "Remains of some unfortunate mecha. Completely unrepairable, but perhaps something can be salvaged."
|
||||
icon = 'icons/mecha/mecha.dmi'
|
||||
density = 1
|
||||
anchored = 0
|
||||
opacity = 0
|
||||
var/list/welder_salvage = list(/obj/item/stack/sheet/plasteel,/obj/item/stack/sheet/metal,/obj/item/stack/rods)
|
||||
var/list/wirecutters_salvage = list(/obj/item/stack/cable_coil)
|
||||
var/list/crowbar_salvage = list()
|
||||
var/salvage_num = 5
|
||||
var/mob/living/silicon/ai/AI //AIs to be salvaged
|
||||
|
||||
/obj/structure/mecha_wreckage/New(loc, mob/living/silicon/ai/AI_pilot)
|
||||
..()
|
||||
if(AI_pilot) //Type-checking for this is already done in mecha/Destroy()
|
||||
AI = AI_pilot
|
||||
AI.apply_damage(150, BURN) //Give the AI a bit of damage from the "shock" of being suddenly shut down
|
||||
AI.death() //The damage is not enough to kill the AI, but to be 'corrupted files' in need of repair.
|
||||
AI.forceMove(src) //Put the dead AI inside the wreckage for recovery
|
||||
add_overlay(mutable_appearance('icons/obj/projectiles.dmi', "green_laser")) //Overlay for the recovery beacon
|
||||
AI.controlled_mech = null
|
||||
AI.remote_control = null
|
||||
|
||||
/obj/structure/mecha_wreckage/examine(mob/user)
|
||||
..()
|
||||
if(AI)
|
||||
to_chat(user, "<span class='notice'>The AI recovery beacon is active.</span>")
|
||||
|
||||
/obj/structure/mecha_wreckage/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/weapon/weldingtool))
|
||||
if(salvage_num <= 0)
|
||||
to_chat(user, "<span class='warning'>You don't see anything that can be cut with [I]!</span>")
|
||||
return
|
||||
var/obj/item/weapon/weldingtool/WT = I
|
||||
if(welder_salvage && welder_salvage.len && WT.remove_fuel(0, user))
|
||||
var/type = prob(70) ? pick(welder_salvage) : null
|
||||
if(type)
|
||||
var/N = new type(get_turf(user))
|
||||
user.visible_message("[user] cuts [N] from [src].", "<span class='notice'>You cut [N] from [src].</span>")
|
||||
if(istype(N, /obj/item/mecha_parts/part))
|
||||
welder_salvage -= type
|
||||
salvage_num--
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You fail to salvage anything valuable from [src]!</span>")
|
||||
else
|
||||
return
|
||||
|
||||
else if(istype(I, /obj/item/weapon/wirecutters))
|
||||
if(salvage_num <= 0)
|
||||
to_chat(user, "<span class='warning'>You don't see anything that can be cut with [I]!</span>")
|
||||
return
|
||||
else if(wirecutters_salvage && wirecutters_salvage.len)
|
||||
var/type = prob(70) ? pick(wirecutters_salvage) : null
|
||||
if(type)
|
||||
var/N = new type(get_turf(user))
|
||||
user.visible_message("[user] cuts [N] from [src].", "<span class='notice'>You cut [N] from [src].</span>")
|
||||
salvage_num--
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You fail to salvage anything valuable from [src]!</span>")
|
||||
|
||||
else if(istype(I, /obj/item/weapon/crowbar))
|
||||
if(crowbar_salvage && crowbar_salvage.len)
|
||||
var/obj/S = pick(crowbar_salvage)
|
||||
if(S)
|
||||
S.loc = get_turf(user)
|
||||
crowbar_salvage -= S
|
||||
user.visible_message("[user] pries [S] from [src].", "<span class='notice'>You pry [S] from [src].</span>")
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You don't see anything that can be pried with [I]!</span>")
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/transfer_ai(interaction, mob/user, null, obj/item/device/aicard/card)
|
||||
if(!..())
|
||||
return
|
||||
|
||||
//Proc called on the wreck by the AI card.
|
||||
if(interaction == AI_TRANS_TO_CARD) //AIs can only be transferred in one direction, from the wreck to the card.
|
||||
if(!AI) //No AI in the wreck
|
||||
to_chat(user, "<span class='warning'>No AI backups found.</span>")
|
||||
return
|
||||
cut_overlays() //Remove the recovery beacon overlay
|
||||
AI.forceMove(card) //Move the dead AI to the card.
|
||||
card.AI = AI
|
||||
if(AI.client) //AI player is still in the dead AI and is connected
|
||||
to_chat(AI, "The remains of your file system have been recovered on a mobile storage device.")
|
||||
else //Give the AI a heads-up that it is probably going to get fixed.
|
||||
AI.notify_ghost_cloning("You have been recovered from the wreckage!", source = card)
|
||||
to_chat(user, "<span class='boldnotice'>Backup files recovered</span>: [AI.name] ([rand(1000,9999)].exe) salvaged from [name] and stored within local memory.")
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/gygax
|
||||
name = "\improper Gygax wreckage"
|
||||
icon_state = "gygax-broken"
|
||||
|
||||
/obj/structure/mecha_wreckage/gygax/New()
|
||||
..()
|
||||
var/list/parts = list(/obj/item/mecha_parts/part/gygax_torso,
|
||||
/obj/item/mecha_parts/part/gygax_head,
|
||||
/obj/item/mecha_parts/part/gygax_left_arm,
|
||||
/obj/item/mecha_parts/part/gygax_right_arm,
|
||||
/obj/item/mecha_parts/part/gygax_left_leg,
|
||||
/obj/item/mecha_parts/part/gygax_right_leg)
|
||||
for(var/i = 0; i < 2; i++)
|
||||
if(parts.len && prob(40))
|
||||
var/part = pick(parts)
|
||||
welder_salvage += part
|
||||
parts -= part
|
||||
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/gygax/dark
|
||||
name = "\improper Dark Gygax wreckage"
|
||||
icon_state = "darkgygax-broken"
|
||||
|
||||
/obj/structure/mecha_wreckage/marauder
|
||||
name = "\improper Marauder wreckage"
|
||||
icon_state = "marauder-broken"
|
||||
|
||||
/obj/structure/mecha_wreckage/mauler
|
||||
name = "\improper Mauler wreckage"
|
||||
icon_state = "mauler-broken"
|
||||
desc = "The syndicate won't be very happy about this..."
|
||||
|
||||
/obj/structure/mecha_wreckage/seraph
|
||||
name = "\improper Seraph wreckage"
|
||||
icon_state = "seraph-broken"
|
||||
|
||||
/obj/structure/mecha_wreckage/reticence
|
||||
name = "\improper Reticence wreckage"
|
||||
icon_state = "reticence-broken"
|
||||
color = "#87878715"
|
||||
desc = "..."
|
||||
|
||||
/obj/structure/mecha_wreckage/ripley
|
||||
name = "\improper Ripley wreckage"
|
||||
icon_state = "ripley-broken"
|
||||
|
||||
/obj/structure/mecha_wreckage/ripley/New()
|
||||
..()
|
||||
var/list/parts = list(/obj/item/mecha_parts/part/ripley_torso,
|
||||
/obj/item/mecha_parts/part/ripley_left_arm,
|
||||
/obj/item/mecha_parts/part/ripley_right_arm,
|
||||
/obj/item/mecha_parts/part/ripley_left_leg,
|
||||
/obj/item/mecha_parts/part/ripley_right_leg)
|
||||
for(var/i = 0; i < 2; i++)
|
||||
if(parts.len && prob(40))
|
||||
var/part = pick(parts)
|
||||
welder_salvage += part
|
||||
parts -= part
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/ripley/firefighter
|
||||
name = "\improper Firefighter wreckage"
|
||||
icon_state = "firefighter-broken"
|
||||
|
||||
/obj/structure/mecha_wreckage/ripley/firefighter/New()
|
||||
..()
|
||||
var/list/parts = list(/obj/item/mecha_parts/part/ripley_torso,
|
||||
/obj/item/mecha_parts/part/ripley_left_arm,
|
||||
/obj/item/mecha_parts/part/ripley_right_arm,
|
||||
/obj/item/mecha_parts/part/ripley_left_leg,
|
||||
/obj/item/mecha_parts/part/ripley_right_leg,
|
||||
/obj/item/clothing/suit/fire)
|
||||
for(var/i = 0; i < 2; i++)
|
||||
if(parts.len && prob(40))
|
||||
var/part = pick(parts)
|
||||
welder_salvage += part
|
||||
parts -= part
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/ripley/deathripley
|
||||
name = "\improper Death-Ripley wreckage"
|
||||
icon_state = "deathripley-broken"
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/honker
|
||||
name = "\improper H.O.N.K wreckage"
|
||||
icon_state = "honker-broken"
|
||||
desc = "All is right in the universe."
|
||||
|
||||
/obj/structure/mecha_wreckage/honker/New()
|
||||
..()
|
||||
var/list/parts = list(
|
||||
/obj/item/mecha_parts/chassis/honker,
|
||||
/obj/item/mecha_parts/part/honker_torso,
|
||||
/obj/item/mecha_parts/part/honker_head,
|
||||
/obj/item/mecha_parts/part/honker_left_arm,
|
||||
/obj/item/mecha_parts/part/honker_right_arm,
|
||||
/obj/item/mecha_parts/part/honker_left_leg,
|
||||
/obj/item/mecha_parts/part/honker_right_leg)
|
||||
for(var/i = 0; i < 2; i++)
|
||||
if(parts.len && prob(40))
|
||||
var/part = pick(parts)
|
||||
welder_salvage += part
|
||||
parts -= part
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/durand
|
||||
name = "\improper Durand wreckage"
|
||||
icon_state = "durand-broken"
|
||||
|
||||
/obj/structure/mecha_wreckage/durand/New()
|
||||
..()
|
||||
var/list/parts = list(
|
||||
/obj/item/mecha_parts/part/durand_torso,
|
||||
/obj/item/mecha_parts/part/durand_head,
|
||||
/obj/item/mecha_parts/part/durand_left_arm,
|
||||
/obj/item/mecha_parts/part/durand_right_arm,
|
||||
/obj/item/mecha_parts/part/durand_left_leg,
|
||||
/obj/item/mecha_parts/part/durand_right_leg)
|
||||
for(var/i = 0; i < 2; i++)
|
||||
if(parts.len && prob(40))
|
||||
var/part = pick(parts)
|
||||
welder_salvage += part
|
||||
parts -= part
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/phazon
|
||||
name = "\improper Phazon wreckage"
|
||||
icon_state = "phazon-broken"
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/odysseus
|
||||
name = "\improper Odysseus wreckage"
|
||||
icon_state = "odysseus-broken"
|
||||
|
||||
/obj/structure/mecha_wreckage/odysseus/New()
|
||||
..()
|
||||
var/list/parts = list(
|
||||
/obj/item/mecha_parts/part/odysseus_torso,
|
||||
/obj/item/mecha_parts/part/odysseus_head,
|
||||
/obj/item/mecha_parts/part/odysseus_left_arm,
|
||||
/obj/item/mecha_parts/part/odysseus_right_arm,
|
||||
/obj/item/mecha_parts/part/odysseus_left_leg,
|
||||
/obj/item/mecha_parts/part/odysseus_right_leg)
|
||||
for(var/i = 0; i < 2; i++)
|
||||
if(parts.len && prob(40))
|
||||
var/part = pick(parts)
|
||||
welder_salvage += part
|
||||
parts -= part
|
||||
AI.controlled_mech = null
|
||||
AI.remote_control = null
|
||||
|
||||
/obj/structure/mecha_wreckage/examine(mob/user)
|
||||
..()
|
||||
if(AI)
|
||||
to_chat(user, "<span class='notice'>The AI recovery beacon is active.</span>")
|
||||
|
||||
/obj/structure/mecha_wreckage/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/weapon/weldingtool))
|
||||
if(salvage_num <= 0)
|
||||
to_chat(user, "<span class='warning'>You don't see anything that can be cut with [I]!</span>")
|
||||
return
|
||||
var/obj/item/weapon/weldingtool/WT = I
|
||||
if(welder_salvage && welder_salvage.len && WT.remove_fuel(0, user))
|
||||
var/type = prob(70) ? pick(welder_salvage) : null
|
||||
if(type)
|
||||
var/N = new type(get_turf(user))
|
||||
user.visible_message("[user] cuts [N] from [src].", "<span class='notice'>You cut [N] from [src].</span>")
|
||||
if(istype(N, /obj/item/mecha_parts/part))
|
||||
welder_salvage -= type
|
||||
salvage_num--
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You fail to salvage anything valuable from [src]!</span>")
|
||||
else
|
||||
return
|
||||
|
||||
else if(istype(I, /obj/item/weapon/wirecutters))
|
||||
if(salvage_num <= 0)
|
||||
to_chat(user, "<span class='warning'>You don't see anything that can be cut with [I]!</span>")
|
||||
return
|
||||
else if(wirecutters_salvage && wirecutters_salvage.len)
|
||||
var/type = prob(70) ? pick(wirecutters_salvage) : null
|
||||
if(type)
|
||||
var/N = new type(get_turf(user))
|
||||
user.visible_message("[user] cuts [N] from [src].", "<span class='notice'>You cut [N] from [src].</span>")
|
||||
salvage_num--
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You fail to salvage anything valuable from [src]!</span>")
|
||||
|
||||
else if(istype(I, /obj/item/weapon/crowbar))
|
||||
if(crowbar_salvage && crowbar_salvage.len)
|
||||
var/obj/S = pick(crowbar_salvage)
|
||||
if(S)
|
||||
S.loc = get_turf(user)
|
||||
crowbar_salvage -= S
|
||||
user.visible_message("[user] pries [S] from [src].", "<span class='notice'>You pry [S] from [src].</span>")
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You don't see anything that can be pried with [I]!</span>")
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/transfer_ai(interaction, mob/user, null, obj/item/device/aicard/card)
|
||||
if(!..())
|
||||
return
|
||||
|
||||
//Proc called on the wreck by the AI card.
|
||||
if(interaction == AI_TRANS_TO_CARD) //AIs can only be transferred in one direction, from the wreck to the card.
|
||||
if(!AI) //No AI in the wreck
|
||||
to_chat(user, "<span class='warning'>No AI backups found.</span>")
|
||||
return
|
||||
cut_overlays() //Remove the recovery beacon overlay
|
||||
AI.forceMove(card) //Move the dead AI to the card.
|
||||
card.AI = AI
|
||||
if(AI.client) //AI player is still in the dead AI and is connected
|
||||
to_chat(AI, "The remains of your file system have been recovered on a mobile storage device.")
|
||||
else //Give the AI a heads-up that it is probably going to get fixed.
|
||||
AI.notify_ghost_cloning("You have been recovered from the wreckage!", source = card)
|
||||
to_chat(user, "<span class='boldnotice'>Backup files recovered</span>: [AI.name] ([rand(1000,9999)].exe) salvaged from [name] and stored within local memory.")
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/gygax
|
||||
name = "\improper Gygax wreckage"
|
||||
icon_state = "gygax-broken"
|
||||
|
||||
/obj/structure/mecha_wreckage/gygax/New()
|
||||
..()
|
||||
var/list/parts = list(/obj/item/mecha_parts/part/gygax_torso,
|
||||
/obj/item/mecha_parts/part/gygax_head,
|
||||
/obj/item/mecha_parts/part/gygax_left_arm,
|
||||
/obj/item/mecha_parts/part/gygax_right_arm,
|
||||
/obj/item/mecha_parts/part/gygax_left_leg,
|
||||
/obj/item/mecha_parts/part/gygax_right_leg)
|
||||
for(var/i = 0; i < 2; i++)
|
||||
if(parts.len && prob(40))
|
||||
var/part = pick(parts)
|
||||
welder_salvage += part
|
||||
parts -= part
|
||||
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/gygax/dark
|
||||
name = "\improper Dark Gygax wreckage"
|
||||
icon_state = "darkgygax-broken"
|
||||
|
||||
/obj/structure/mecha_wreckage/marauder
|
||||
name = "\improper Marauder wreckage"
|
||||
icon_state = "marauder-broken"
|
||||
|
||||
/obj/structure/mecha_wreckage/mauler
|
||||
name = "\improper Mauler wreckage"
|
||||
icon_state = "mauler-broken"
|
||||
desc = "The syndicate won't be very happy about this..."
|
||||
|
||||
/obj/structure/mecha_wreckage/seraph
|
||||
name = "\improper Seraph wreckage"
|
||||
icon_state = "seraph-broken"
|
||||
|
||||
/obj/structure/mecha_wreckage/reticence
|
||||
name = "\improper Reticence wreckage"
|
||||
icon_state = "reticence-broken"
|
||||
color = "#87878715"
|
||||
desc = "..."
|
||||
|
||||
/obj/structure/mecha_wreckage/ripley
|
||||
name = "\improper Ripley wreckage"
|
||||
icon_state = "ripley-broken"
|
||||
|
||||
/obj/structure/mecha_wreckage/ripley/New()
|
||||
..()
|
||||
var/list/parts = list(/obj/item/mecha_parts/part/ripley_torso,
|
||||
/obj/item/mecha_parts/part/ripley_left_arm,
|
||||
/obj/item/mecha_parts/part/ripley_right_arm,
|
||||
/obj/item/mecha_parts/part/ripley_left_leg,
|
||||
/obj/item/mecha_parts/part/ripley_right_leg)
|
||||
for(var/i = 0; i < 2; i++)
|
||||
if(parts.len && prob(40))
|
||||
var/part = pick(parts)
|
||||
welder_salvage += part
|
||||
parts -= part
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/ripley/firefighter
|
||||
name = "\improper Firefighter wreckage"
|
||||
icon_state = "firefighter-broken"
|
||||
|
||||
/obj/structure/mecha_wreckage/ripley/firefighter/New()
|
||||
..()
|
||||
var/list/parts = list(/obj/item/mecha_parts/part/ripley_torso,
|
||||
/obj/item/mecha_parts/part/ripley_left_arm,
|
||||
/obj/item/mecha_parts/part/ripley_right_arm,
|
||||
/obj/item/mecha_parts/part/ripley_left_leg,
|
||||
/obj/item/mecha_parts/part/ripley_right_leg,
|
||||
/obj/item/clothing/suit/fire)
|
||||
for(var/i = 0; i < 2; i++)
|
||||
if(parts.len && prob(40))
|
||||
var/part = pick(parts)
|
||||
welder_salvage += part
|
||||
parts -= part
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/ripley/deathripley
|
||||
name = "\improper Death-Ripley wreckage"
|
||||
icon_state = "deathripley-broken"
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/honker
|
||||
name = "\improper H.O.N.K wreckage"
|
||||
icon_state = "honker-broken"
|
||||
desc = "All is right in the universe."
|
||||
|
||||
/obj/structure/mecha_wreckage/honker/New()
|
||||
..()
|
||||
var/list/parts = list(
|
||||
/obj/item/mecha_parts/chassis/honker,
|
||||
/obj/item/mecha_parts/part/honker_torso,
|
||||
/obj/item/mecha_parts/part/honker_head,
|
||||
/obj/item/mecha_parts/part/honker_left_arm,
|
||||
/obj/item/mecha_parts/part/honker_right_arm,
|
||||
/obj/item/mecha_parts/part/honker_left_leg,
|
||||
/obj/item/mecha_parts/part/honker_right_leg)
|
||||
for(var/i = 0; i < 2; i++)
|
||||
if(parts.len && prob(40))
|
||||
var/part = pick(parts)
|
||||
welder_salvage += part
|
||||
parts -= part
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/durand
|
||||
name = "\improper Durand wreckage"
|
||||
icon_state = "durand-broken"
|
||||
|
||||
/obj/structure/mecha_wreckage/durand/New()
|
||||
..()
|
||||
var/list/parts = list(
|
||||
/obj/item/mecha_parts/part/durand_torso,
|
||||
/obj/item/mecha_parts/part/durand_head,
|
||||
/obj/item/mecha_parts/part/durand_left_arm,
|
||||
/obj/item/mecha_parts/part/durand_right_arm,
|
||||
/obj/item/mecha_parts/part/durand_left_leg,
|
||||
/obj/item/mecha_parts/part/durand_right_leg)
|
||||
for(var/i = 0; i < 2; i++)
|
||||
if(parts.len && prob(40))
|
||||
var/part = pick(parts)
|
||||
welder_salvage += part
|
||||
parts -= part
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/phazon
|
||||
name = "\improper Phazon wreckage"
|
||||
icon_state = "phazon-broken"
|
||||
|
||||
|
||||
/obj/structure/mecha_wreckage/odysseus
|
||||
name = "\improper Odysseus wreckage"
|
||||
icon_state = "odysseus-broken"
|
||||
|
||||
/obj/structure/mecha_wreckage/odysseus/New()
|
||||
..()
|
||||
var/list/parts = list(
|
||||
/obj/item/mecha_parts/part/odysseus_torso,
|
||||
/obj/item/mecha_parts/part/odysseus_head,
|
||||
/obj/item/mecha_parts/part/odysseus_left_arm,
|
||||
/obj/item/mecha_parts/part/odysseus_right_arm,
|
||||
/obj/item/mecha_parts/part/odysseus_left_leg,
|
||||
/obj/item/mecha_parts/part/odysseus_right_leg)
|
||||
for(var/i = 0; i < 2; i++)
|
||||
if(parts.len && prob(40))
|
||||
var/part = pick(parts)
|
||||
welder_salvage += part
|
||||
parts -= part
|
||||
|
||||
+155
-157
@@ -1,98 +1,98 @@
|
||||
/obj/mecha/working/ripley
|
||||
desc = "Autonomous Power Loader Unit. This newer model is refitted with powerful armour against the dangers of the EVA mining process."
|
||||
name = "\improper APLU \"Ripley\""
|
||||
icon_state = "ripley"
|
||||
step_in = 4 //Move speed, lower is faster.
|
||||
var/hi_pres_step_in = 4 //step_in while in high pressure.
|
||||
var/lo_pres_step_in = 2 //step_in while in low/zero pressure.
|
||||
max_temperature = 20000
|
||||
obj_integrity = 200
|
||||
max_integrity = 200
|
||||
lights_power = 7
|
||||
deflect_chance = 15
|
||||
armor = list(melee = 40, bullet = 20, laser = 10, energy = 20, bomb = 40, bio = 0, rad = 0, fire = 100, acid = 100)
|
||||
max_equip = 6
|
||||
wreckage = /obj/structure/mecha_wreckage/ripley
|
||||
var/list/cargo = new
|
||||
var/cargo_capacity = 15
|
||||
var/hides = 0
|
||||
|
||||
/obj/mecha/working/ripley/Move()
|
||||
. = ..()
|
||||
/obj/mecha/working/ripley
|
||||
desc = "Autonomous Power Loader Unit. This newer model is refitted with powerful armour against the dangers of planetary mining."
|
||||
name = "\improper APLU \"Ripley\""
|
||||
icon_state = "ripley"
|
||||
step_in = 4 //Move speed, lower is faster.
|
||||
var/fast_pressure_step_in = 2 //step_in while in normal pressure conditions
|
||||
var/slow_pressure_step_in = 4 //step_in while in better pressure conditions
|
||||
max_temperature = 20000
|
||||
obj_integrity = 200
|
||||
max_integrity = 200
|
||||
lights_power = 7
|
||||
deflect_chance = 15
|
||||
armor = list(melee = 40, bullet = 20, laser = 10, energy = 20, bomb = 40, bio = 0, rad = 0, fire = 100, acid = 100)
|
||||
max_equip = 6
|
||||
wreckage = /obj/structure/mecha_wreckage/ripley
|
||||
var/list/cargo = new
|
||||
var/cargo_capacity = 15
|
||||
var/hides = 0
|
||||
|
||||
/obj/mecha/working/ripley/Move()
|
||||
. = ..()
|
||||
if(.)
|
||||
collect_ore()
|
||||
update_pressure()
|
||||
|
||||
/obj/mecha/working/ripley/proc/collect_ore()
|
||||
if(locate(/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp) in equipment)
|
||||
var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in cargo
|
||||
if(ore_box)
|
||||
var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in cargo
|
||||
if(ore_box)
|
||||
for(var/obj/item/weapon/ore/ore in range(1, src))
|
||||
if(ore.Adjacent(src) && ((get_dir(src, ore) & dir) || ore.loc == loc)) //we can reach it and it's in front of us? grab it!
|
||||
ore.forceMove(ore_box)
|
||||
|
||||
/obj/mecha/working/ripley/Destroy()
|
||||
for(var/i=1, i <= hides, i++)
|
||||
new /obj/item/stack/sheet/animalhide/goliath_hide(loc) //If a goliath-plated ripley gets killed, all the plates drop
|
||||
for(var/atom/movable/A in cargo)
|
||||
A.forceMove(loc)
|
||||
step_rand(A)
|
||||
cargo.Cut()
|
||||
return ..()
|
||||
|
||||
/obj/mecha/working/ripley/go_out()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/mecha/working/ripley/moved_inside(mob/living/carbon/human/H)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/mecha/working/ripley/update_icon()
|
||||
..()
|
||||
if (hides)
|
||||
cut_overlays()
|
||||
if(hides < 3)
|
||||
|
||||
/obj/mecha/working/ripley/Destroy()
|
||||
for(var/i=1, i <= hides, i++)
|
||||
new /obj/item/stack/sheet/animalhide/goliath_hide(loc) //If a goliath-plated ripley gets killed, all the plates drop
|
||||
for(var/atom/movable/A in cargo)
|
||||
A.forceMove(loc)
|
||||
step_rand(A)
|
||||
cargo.Cut()
|
||||
return ..()
|
||||
|
||||
/obj/mecha/working/ripley/go_out()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/mecha/working/ripley/moved_inside(mob/living/carbon/human/H)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/mecha/working/ripley/update_icon()
|
||||
..()
|
||||
if (hides)
|
||||
cut_overlays()
|
||||
if(hides < 3)
|
||||
add_overlay(occupant ? "ripley-g" : "ripley-g-open")
|
||||
else
|
||||
else
|
||||
add_overlay(occupant ? "ripley-g-full" : "ripley-g-full-open")
|
||||
|
||||
|
||||
/obj/mecha/working/ripley/firefighter
|
||||
desc = "Autonomous Power Loader Unit. This model is refitted with additional thermal protection."
|
||||
name = "\improper APLU \"Firefighter\""
|
||||
icon_state = "firefighter"
|
||||
max_temperature = 65000
|
||||
obj_integrity = 250
|
||||
max_integrity = 250
|
||||
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
|
||||
lights_power = 7
|
||||
armor = list(melee = 40, bullet = 30, laser = 30, energy = 30, bomb = 60, bio = 0, rad = 0, fire = 100, acid = 100)
|
||||
max_equip = 5 // More armor, less tools
|
||||
wreckage = /obj/structure/mecha_wreckage/ripley/firefighter
|
||||
|
||||
|
||||
/obj/mecha/working/ripley/deathripley
|
||||
desc = "OH SHIT IT'S THE DEATHSQUAD WE'RE ALL GONNA DIE"
|
||||
name = "\improper DEATH-RIPLEY"
|
||||
icon_state = "deathripley"
|
||||
hi_pres_step_in = 3
|
||||
opacity=0
|
||||
lights_power = 7
|
||||
wreckage = /obj/structure/mecha_wreckage/ripley/deathripley
|
||||
step_energy_drain = 0
|
||||
|
||||
/obj/mecha/working/ripley/deathripley/New()
|
||||
..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/kill
|
||||
ME.attach(src)
|
||||
return
|
||||
|
||||
/obj/mecha/working/ripley/mining
|
||||
desc = "An old, dusty mining Ripley."
|
||||
name = "\improper APLU \"Miner\""
|
||||
|
||||
|
||||
/obj/mecha/working/ripley/firefighter
|
||||
desc = "Autonomous Power Loader Unit. This model is refitted with additional thermal protection."
|
||||
name = "\improper APLU \"Firefighter\""
|
||||
icon_state = "firefighter"
|
||||
max_temperature = 65000
|
||||
obj_integrity = 250
|
||||
max_integrity = 250
|
||||
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
|
||||
lights_power = 7
|
||||
armor = list(melee = 40, bullet = 30, laser = 30, energy = 30, bomb = 60, bio = 0, rad = 0, fire = 100, acid = 100)
|
||||
max_equip = 5 // More armor, less tools
|
||||
wreckage = /obj/structure/mecha_wreckage/ripley/firefighter
|
||||
|
||||
|
||||
/obj/mecha/working/ripley/deathripley
|
||||
desc = "OH SHIT IT'S THE DEATHSQUAD WE'RE ALL GONNA DIE"
|
||||
name = "\improper DEATH-RIPLEY"
|
||||
icon_state = "deathripley"
|
||||
slow_pressure_step_in = 3
|
||||
opacity=0
|
||||
lights_power = 7
|
||||
wreckage = /obj/structure/mecha_wreckage/ripley/deathripley
|
||||
step_energy_drain = 0
|
||||
|
||||
/obj/mecha/working/ripley/deathripley/New()
|
||||
..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/kill
|
||||
ME.attach(src)
|
||||
return
|
||||
|
||||
/obj/mecha/working/ripley/mining
|
||||
desc = "An old, dusty mining Ripley."
|
||||
name = "\improper APLU \"Miner\""
|
||||
obj_integrity = 75 //Low starting health
|
||||
|
||||
|
||||
/obj/mecha/working/ripley/mining/Initialize()
|
||||
. = ..()
|
||||
if(cell)
|
||||
@@ -104,81 +104,79 @@
|
||||
else
|
||||
var/obj/item/mecha_parts/mecha_equipment/drill/D = new
|
||||
D.attach(src)
|
||||
|
||||
|
||||
else //Add possible plasma cutter if no drill
|
||||
var/obj/item/mecha_parts/mecha_equipment/M = new
|
||||
M.attach(src)
|
||||
|
||||
//Add ore box to cargo
|
||||
cargo.Add(new /obj/structure/ore_box(src))
|
||||
|
||||
//Attach hydraulic clamp
|
||||
M.attach(src)
|
||||
|
||||
//Add ore box to cargo
|
||||
cargo.Add(new /obj/structure/ore_box(src))
|
||||
|
||||
//Attach hydraulic clamp
|
||||
var/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/HC = new
|
||||
HC.attach(src)
|
||||
for(var/obj/item/mecha_parts/mecha_tracking/B in trackers)//Deletes the beacon so it can't be found easily
|
||||
qdel(B)
|
||||
|
||||
HC.attach(src)
|
||||
for(var/obj/item/mecha_parts/mecha_tracking/B in trackers)//Deletes the beacon so it can't be found easily
|
||||
qdel(B)
|
||||
|
||||
var/obj/item/mecha_parts/mecha_equipment/mining_scanner/scanner = new
|
||||
scanner.attach(src)
|
||||
|
||||
/obj/mecha/working/ripley/Exit(atom/movable/O)
|
||||
if(O in cargo)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/obj/mecha/working/ripley/Topic(href, href_list)
|
||||
..()
|
||||
if(href_list["drop_from_cargo"])
|
||||
var/obj/O = locate(href_list["drop_from_cargo"])
|
||||
if(O && O in src.cargo)
|
||||
src.occupant_message("<span class='notice'>You unload [O].</span>")
|
||||
O.forceMove(loc)
|
||||
src.cargo -= O
|
||||
src.log_message("Unloaded [O]. Cargo compartment capacity: [cargo_capacity - src.cargo.len]")
|
||||
return
|
||||
|
||||
|
||||
/obj/mecha/working/ripley/contents_explosion(severity, target)
|
||||
for(var/X in cargo)
|
||||
var/obj/O = X
|
||||
if(prob(30/severity))
|
||||
cargo -= O
|
||||
O.forceMove(loc)
|
||||
. = ..()
|
||||
|
||||
/obj/mecha/working/ripley/get_stats_part()
|
||||
var/output = ..()
|
||||
output += "<b>Cargo Compartment Contents:</b><div style=\"margin-left: 15px;\">"
|
||||
if(cargo.len)
|
||||
for(var/obj/O in cargo)
|
||||
output += "<a href='?src=\ref[src];drop_from_cargo=\ref[O]'>Unload</a> : [O]<br>"
|
||||
else
|
||||
output += "Nothing"
|
||||
output += "</div>"
|
||||
return output
|
||||
|
||||
/obj/mecha/working/ripley/proc/update_pressure()
|
||||
var/turf/T = get_turf(loc)
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
var/pressure = environment.return_pressure()
|
||||
|
||||
if(pressure < 40)
|
||||
step_in = lo_pres_step_in
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/drill/drill in equipment)
|
||||
drill.equip_cooldown = initial(drill.equip_cooldown)/2
|
||||
else
|
||||
step_in = hi_pres_step_in
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/drill/drill in equipment)
|
||||
drill.equip_cooldown = initial(drill.equip_cooldown)
|
||||
|
||||
/obj/mecha/working/ripley/relay_container_resist(mob/living/user, obj/O)
|
||||
to_chat(user, "<span class='notice'>You lean on the back of [O] and start pushing so it falls out of [src].</span>")
|
||||
if(do_after(user, 300, target = O))
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src || O.loc != src )
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You successfully pushed [O] out of [src]!</span>")
|
||||
O.loc = loc
|
||||
cargo -= O
|
||||
else
|
||||
if(user.loc == src) //so we don't get the message if we resisted multiple times and succeeded.
|
||||
to_chat(user, "<span class='warning'>You fail to push [O] out of [src]!</span>")
|
||||
scanner.attach(src)
|
||||
|
||||
/obj/mecha/working/ripley/Exit(atom/movable/O)
|
||||
if(O in cargo)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/obj/mecha/working/ripley/Topic(href, href_list)
|
||||
..()
|
||||
if(href_list["drop_from_cargo"])
|
||||
var/obj/O = locate(href_list["drop_from_cargo"])
|
||||
if(O && O in src.cargo)
|
||||
src.occupant_message("<span class='notice'>You unload [O].</span>")
|
||||
O.forceMove(loc)
|
||||
src.cargo -= O
|
||||
src.log_message("Unloaded [O]. Cargo compartment capacity: [cargo_capacity - src.cargo.len]")
|
||||
return
|
||||
|
||||
|
||||
/obj/mecha/working/ripley/contents_explosion(severity, target)
|
||||
for(var/X in cargo)
|
||||
var/obj/O = X
|
||||
if(prob(30/severity))
|
||||
cargo -= O
|
||||
O.forceMove(loc)
|
||||
. = ..()
|
||||
|
||||
/obj/mecha/working/ripley/get_stats_part()
|
||||
var/output = ..()
|
||||
output += "<b>Cargo Compartment Contents:</b><div style=\"margin-left: 15px;\">"
|
||||
if(cargo.len)
|
||||
for(var/obj/O in cargo)
|
||||
output += "<a href='?src=\ref[src];drop_from_cargo=\ref[O]'>Unload</a> : [O]<br>"
|
||||
else
|
||||
output += "Nothing"
|
||||
output += "</div>"
|
||||
return output
|
||||
|
||||
/obj/mecha/working/ripley/proc/update_pressure()
|
||||
var/turf/T = get_turf(loc)
|
||||
|
||||
if(lavaland_equipment_pressure_check(T))
|
||||
step_in = fast_pressure_step_in
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/drill/drill in equipment)
|
||||
drill.equip_cooldown = initial(drill.equip_cooldown)/2
|
||||
else
|
||||
step_in = slow_pressure_step_in
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/drill/drill in equipment)
|
||||
drill.equip_cooldown = initial(drill.equip_cooldown)
|
||||
|
||||
/obj/mecha/working/ripley/relay_container_resist(mob/living/user, obj/O)
|
||||
to_chat(user, "<span class='notice'>You lean on the back of [O] and start pushing so it falls out of [src].</span>")
|
||||
if(do_after(user, 300, target = O))
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src || O.loc != src )
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You successfully pushed [O] out of [src]!</span>")
|
||||
O.loc = loc
|
||||
cargo -= O
|
||||
else
|
||||
if(user.loc == src) //so we don't get the message if we resisted multiple times and succeeded.
|
||||
to_chat(user, "<span class='warning'>You fail to push [O] out of [src]!</span>")
|
||||
|
||||
Reference in New Issue
Block a user