mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge branch 'dev' into ofChemistryAndStuff
Conflicts: code/datums/recipe.dm code/game/machinery/bots/farmbot.dm code/game/machinery/bots/medbot.dm code/game/mecha/equipment/tools/tools.dm code/game/objects/effects/chem/chemsmoke.dm code/game/objects/effects/effect_system.dm code/game/objects/items/toys.dm code/game/objects/items/weapons/extinguisher.dm code/game/objects/items/weapons/mop.dm code/modules/mob/living/carbon/human/human.dm code/modules/organs/organ_internal.dm code/modules/reagents/Chemistry-Holder.dm code/modules/reagents/Chemistry-Reagents.dm code/modules/reagents/Chemistry-Recipes.dm code/modules/reagents/reagent_containers/food/snacks.dm code/modules/reagents/reagent_containers/pill.dm code/modules/reagents/reagent_containers/spray.dm maps/exodus-1.dmm
This commit is contained in:
@@ -63,7 +63,7 @@
|
||||
if(equipment.len)//Now to remove it and equip anew.
|
||||
for(ME in equipment)
|
||||
equipment -= ME
|
||||
del(ME)
|
||||
qdel(ME)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/scattershot(src)
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive(src)
|
||||
@@ -76,6 +76,10 @@
|
||||
ME.attach(src)
|
||||
return
|
||||
|
||||
/obj/mecha/combat/marauder/Destroy()
|
||||
qdel(smoke_system)
|
||||
..()
|
||||
|
||||
/obj/mecha/combat/marauder/relaymove(mob/user,direction)
|
||||
if(user != src.occupant) //While not "realistic", this piece is player friendly.
|
||||
user.loc = get_turf(src)
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
else
|
||||
chassis.occupant << sound('sound/mecha/critdestr.ogg',volume=50)
|
||||
spawn
|
||||
del src
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/critfail()
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
pr_mech_sleeper.set_delay(equip_cooldown)
|
||||
return
|
||||
|
||||
Destroy()
|
||||
qdel(pr_mech_sleeper)
|
||||
..()
|
||||
|
||||
allow_drop()
|
||||
return 0
|
||||
|
||||
|
||||
@@ -15,21 +15,22 @@
|
||||
action(atom/target)
|
||||
if(!action_checks(target)) return
|
||||
if(!cargo_holder) return
|
||||
|
||||
|
||||
//loading
|
||||
if(istype(target,/obj))
|
||||
var/obj/O = target
|
||||
if(O.buckled_mob)
|
||||
return
|
||||
if(locate(/mob/living) in O)
|
||||
occupant_message("<span class='warning'>You can't load living things into the cargo compartment.</span>")
|
||||
return
|
||||
if(O.anchored)
|
||||
occupant_message("<font color='red'>[target] is firmly secured.</font>")
|
||||
occupant_message("<span class='warning'>[target] is firmly secured.</span>")
|
||||
return
|
||||
if(cargo_holder.cargo.len >= cargo_holder.cargo_capacity)
|
||||
occupant_message("<font color='red'>Not enough room in cargo compartment.</font>")
|
||||
occupant_message("<span class='warning'>Not enough room in cargo compartment.</span>")
|
||||
return
|
||||
|
||||
|
||||
occupant_message("You lift [target] and start to load it into cargo compartment.")
|
||||
chassis.visible_message("[chassis] lifts [target] and starts to load it into cargo compartment.")
|
||||
set_ready_state(0)
|
||||
@@ -41,10 +42,10 @@
|
||||
cargo_holder.cargo += O
|
||||
O.loc = chassis
|
||||
O.anchored = 0
|
||||
occupant_message("<font color='blue'>[target] succesfully loaded.</font>")
|
||||
occupant_message("<span class='notice'>[target] succesfully loaded.</span>")
|
||||
log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
|
||||
else
|
||||
occupant_message("<font color='red'>You must hold still while handling objects.</font>")
|
||||
occupant_message("<span class='warning'>You must hold still while handling objects.</span>")
|
||||
O.anchored = initial(O.anchored)
|
||||
|
||||
//attacking
|
||||
@@ -55,8 +56,8 @@
|
||||
M.take_overall_damage(dam_force)
|
||||
M.adjustOxyLoss(round(dam_force/2))
|
||||
M.updatehealth()
|
||||
occupant_message("\red You squeeze [target] with [src.name]. Something cracks.")
|
||||
chassis.visible_message("\red [chassis] squeezes [target].")
|
||||
occupant_message("<span class='warning'>You squeeze [target] with [src.name]. Something cracks.</span>")
|
||||
chassis.visible_message("<span class='warning'>[chassis] squeezes [target].</span>")
|
||||
else
|
||||
step_away(M,chassis)
|
||||
occupant_message("You push [target] out of the way.")
|
||||
@@ -82,14 +83,14 @@
|
||||
if(!target_obj.vars.Find("unacidable") || target_obj.unacidable) return
|
||||
set_ready_state(0)
|
||||
chassis.use_power(energy_drain)
|
||||
chassis.visible_message("<font color='red'><b>[chassis] starts to drill [target]</b></font>", "You hear the drill.")
|
||||
occupant_message("<font color='red'><b>You start to drill [target]</b></font>")
|
||||
chassis.visible_message("<span class='danger'>[chassis] starts to drill [target]</span>", "<span class='warning'>You hear the drill.</span>")
|
||||
occupant_message("<span class='danger'>You start to drill [target]</span>")
|
||||
var/T = chassis.loc
|
||||
var/C = target.loc //why are these backwards? we may never know -Pete
|
||||
if(do_after_cooldown(target))
|
||||
if(T == chassis.loc && src == chassis.selected)
|
||||
if(istype(target, /turf/simulated/wall/r_wall))
|
||||
occupant_message("<font color='red'>[target] is too durable to drill through.</font>")
|
||||
occupant_message("<span class='warning'>[target] is too durable to drill through.</span>")
|
||||
else if(istype(target, /turf/simulated/mineral))
|
||||
for(var/turf/simulated/mineral/M in range(chassis,1))
|
||||
if(get_dir(chassis,M)&chassis.dir)
|
||||
@@ -133,8 +134,8 @@
|
||||
if(target_obj.unacidable) return
|
||||
set_ready_state(0)
|
||||
chassis.use_power(energy_drain)
|
||||
chassis.visible_message("<font color='red'><b>[chassis] starts to drill [target]</b></font>", "You hear the drill.")
|
||||
occupant_message("<font color='red'><b>You start to drill [target]</b></font>")
|
||||
chassis.visible_message("<span class='danger'>[chassis] starts to drill [target]</span>", "<span class='warning'>You hear the drill.</span>")
|
||||
occupant_message("<span class='danger'>You start to drill [target]</span>")
|
||||
var/T = chassis.loc
|
||||
var/C = target.loc //why are these backwards? we may never know -Pete
|
||||
if(do_after_cooldown(target))
|
||||
@@ -193,14 +194,14 @@
|
||||
set_ready_state(0)
|
||||
if(do_after_cooldown(target))
|
||||
if( istype(target, /obj/structure/reagent_dispensers/watertank) && get_dist(chassis,target) <= 1)
|
||||
var/obj/o = target
|
||||
var/obj/o = target
|
||||
var/amount = o.reagents.trans_to_obj(src, 200)
|
||||
occupant_message("\blue [amount] units transferred into internal tank.")
|
||||
occupant_message("<span class='notice'>[amount] units transferred into internal tank.</span>")
|
||||
playsound(chassis, 'sound/effects/refill.ogg', 50, 1, -6)
|
||||
return
|
||||
|
||||
if (src.reagents.total_volume < 1)
|
||||
occupant_message("\red \The [src] is empty.")
|
||||
occupant_message("<span class='warning'>\The [src] is empty.</span>")
|
||||
return
|
||||
|
||||
playsound(chassis, 'sound/effects/extinguish.ogg', 75, 1, -3)
|
||||
@@ -214,8 +215,8 @@
|
||||
var/list/the_targets = list(T,T1,T2)
|
||||
|
||||
for(var/a = 1 to 5)
|
||||
spawn(0)
|
||||
var/obj/effect/effect/water/W = new /obj/effect/effect/water(get_turf(chassis))
|
||||
spawn(0)
|
||||
var/obj/effect/effect/water/W = PoolOrNew(/obj/effect/effect/water, get_turf(chassis))
|
||||
var/turf/my_target
|
||||
if(a == 1)
|
||||
my_target = T
|
||||
@@ -226,11 +227,11 @@
|
||||
else
|
||||
my_target = pick(the_targets)
|
||||
W.create_reagents(5)
|
||||
if(!src)
|
||||
if(!W || !src)
|
||||
return
|
||||
reagents.trans_to_obj(W, spray_amount)
|
||||
W.set_color()
|
||||
W.set_up(my_target)
|
||||
W.set_up(my_target)
|
||||
return 1
|
||||
|
||||
get_equip_info()
|
||||
@@ -289,7 +290,7 @@
|
||||
if(do_after_cooldown(target))
|
||||
if(disabled) return
|
||||
chassis.spark_system.start()
|
||||
del(target)
|
||||
qdel(target)
|
||||
playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
chassis.use_power(energy_drain)
|
||||
if(1)
|
||||
@@ -412,7 +413,7 @@
|
||||
do_after_cooldown()
|
||||
src = null
|
||||
spawn(rand(150,300))
|
||||
del(P)
|
||||
qdel(P)
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/gravcatapult
|
||||
@@ -435,7 +436,7 @@
|
||||
last_fired = world.time
|
||||
else
|
||||
if (world.time % 3)
|
||||
occupant_message("<span class='warning'>[src] is not ready to fire again!")
|
||||
occupant_message("<span class='warning'>[src] is not ready to fire again!</span>")
|
||||
return 0
|
||||
|
||||
switch(mode)
|
||||
@@ -531,8 +532,8 @@
|
||||
user << "\red The [W] bounces off [chassis] armor."
|
||||
chassis.log_append_to_last("Armor saved.")
|
||||
else
|
||||
chassis.occupant_message("<font color='red'><b>[user] hits [chassis] with [W].</b></font>")
|
||||
user.visible_message("<font color='red'><b>[user] hits [chassis] with [W].</b></font>", "<font color='red'><b>You hit [src] with [W].</b></font>")
|
||||
chassis.occupant_message("<span class='danger'>[user] hits [chassis] with [W].</span>")
|
||||
user.visible_message("<span class='danger'><b>[user] hits [chassis] with [W].</span>", "<span class='danger'>You hit [src] with [W].</span>")
|
||||
chassis.take_damage(round(W.force*damage_coeff),W.damtype)
|
||||
chassis.check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
|
||||
set_ready_state(0)
|
||||
@@ -579,7 +580,7 @@
|
||||
if(!action_checks(src))
|
||||
return chassis.dynbulletdamage(Proj)
|
||||
if(prob(chassis.deflect_chance*deflect_coeff))
|
||||
chassis.occupant_message("\blue The armor deflects incoming projectile.")
|
||||
chassis.occupant_message("<span class='notice'>The armor deflects incoming projectile.</span>")
|
||||
chassis.visible_message("The [chassis.name] armor deflects the projectile")
|
||||
chassis.log_append_to_last("Armor saved.")
|
||||
else
|
||||
@@ -595,7 +596,7 @@
|
||||
if(!action_checks(A))
|
||||
return chassis.dynhitby(A)
|
||||
if(prob(chassis.deflect_chance*deflect_coeff) || istype(A, /mob/living) || istype(A, /obj/item/mecha_parts/mecha_tracking))
|
||||
chassis.occupant_message("\blue The [A] bounces off the armor.")
|
||||
chassis.occupant_message("<span class='notice'>The [A] bounces off the armor.</span>")
|
||||
chassis.visible_message("The [A] bounces off the [chassis] armor")
|
||||
chassis.log_append_to_last("Armor saved.")
|
||||
if(istype(A, /mob/living))
|
||||
@@ -632,6 +633,11 @@
|
||||
pr_repair_droid.set_delay(equip_cooldown)
|
||||
return
|
||||
|
||||
Destroy()
|
||||
qdel(pr_repair_droid)
|
||||
pr_repair_droid = null
|
||||
..()
|
||||
|
||||
attach(obj/mecha/M as obj)
|
||||
..()
|
||||
droid_overlay = new(src.icon, icon_state = "repair_droid")
|
||||
@@ -721,6 +727,11 @@
|
||||
pr_energy_relay.set_delay(equip_cooldown)
|
||||
return
|
||||
|
||||
Destroy()
|
||||
qdel(pr_energy_relay)
|
||||
pr_energy_relay = null
|
||||
..()
|
||||
|
||||
detach()
|
||||
pr_energy_relay.stop()
|
||||
// chassis.proc_res["dynusepower"] = null
|
||||
@@ -837,6 +848,11 @@
|
||||
init()
|
||||
return
|
||||
|
||||
Destroy()
|
||||
qdel(pr_mech_generator)
|
||||
pr_mech_generator = null
|
||||
..()
|
||||
|
||||
proc/init()
|
||||
fuel = new /obj/item/stack/sheet/mineral/phoron(src)
|
||||
fuel.amount = 0
|
||||
@@ -872,7 +888,7 @@
|
||||
var/result = load_fuel(target)
|
||||
var/message
|
||||
if(isnull(result))
|
||||
message = "<font color='red'>[fuel] traces in target minimal. [target] cannot be used as fuel.</font>"
|
||||
message = "<span class='warning'>[fuel] traces in target minimal. [target] cannot be used as fuel.</span>"
|
||||
else if(!result)
|
||||
message = "Unit is full."
|
||||
else
|
||||
@@ -897,7 +913,7 @@
|
||||
attackby(weapon,mob/user)
|
||||
var/result = load_fuel(weapon)
|
||||
if(isnull(result))
|
||||
user.visible_message("[user] tries to shove [weapon] into [src]. What a dumb-ass.","<font color='red'>[fuel] traces minimal. [weapon] cannot be used as fuel.</font>")
|
||||
user.visible_message("[user] tries to shove [weapon] into [src]. What a dumb-ass.","<span class='warning'>[fuel] traces minimal. [weapon] cannot be used as fuel.</span>")
|
||||
else if(!result)
|
||||
user << "Unit is full."
|
||||
else
|
||||
@@ -1021,25 +1037,25 @@
|
||||
cargo_holder.cargo += O
|
||||
O.loc = chassis
|
||||
O.anchored = 0
|
||||
chassis.occupant_message("<font color='blue'>[target] succesfully loaded.</font>")
|
||||
chassis.occupant_message("<span class='notice'>[target] succesfully loaded.</span>")
|
||||
chassis.log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
|
||||
else
|
||||
chassis.occupant_message("<font color='red'>You must hold still while handling objects.</font>")
|
||||
chassis.occupant_message("<span class='warning'>You must hold still while handling objects.</span>")
|
||||
O.anchored = initial(O.anchored)
|
||||
else
|
||||
chassis.occupant_message("<font color='red'>Not enough room in cargo compartment.</font>")
|
||||
chassis.occupant_message("<span class='warning'>Not enough room in cargo compartment.</span>")
|
||||
else
|
||||
chassis.occupant_message("<font color='red'>[target] is firmly secured.</font>")
|
||||
chassis.occupant_message("<span class='warning'>[target] is firmly secured.</span>")
|
||||
|
||||
else if(istype(target,/mob/living))
|
||||
var/mob/living/M = target
|
||||
if(M.stat>1) return
|
||||
if(chassis.occupant.a_intent == I_HURT)
|
||||
chassis.occupant_message("\red You obliterate [target] with [src.name], leaving blood and guts everywhere.")
|
||||
chassis.visible_message("\red [chassis] destroys [target] in an unholy fury.")
|
||||
chassis.occupant_message("<span class='danger'>You obliterate [target] with [src.name], leaving blood and guts everywhere.</span>")
|
||||
chassis.visible_message("<span class='danger'>[chassis] destroys [target] in an unholy fury.<span>")
|
||||
if(chassis.occupant.a_intent == I_DISARM)
|
||||
chassis.occupant_message("\red You tear [target]'s limbs off with [src.name].")
|
||||
chassis.visible_message("\red [chassis] rips [target]'s arms off.")
|
||||
chassis.occupant_message("<span class='danger'>You tear [target]'s limbs off with [src.name].</span>")
|
||||
chassis.visible_message("<span class='danger'>[chassis] rips [target]'s arms off.</span>")
|
||||
else
|
||||
step_away(M,chassis)
|
||||
chassis.occupant_message("You smash into [target], sending them flying.")
|
||||
@@ -1081,7 +1097,7 @@
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/passenger/destroy()
|
||||
for(var/atom/movable/AM in src)
|
||||
AM.forceMove(get_turf(src))
|
||||
AM << "<span class='danger'>You tumble out of the destroyed [src.name]!"
|
||||
AM << "<span class='danger'>You tumble out of the destroyed [src.name]!</span>"
|
||||
return ..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/passenger/Exit(atom/movable/O)
|
||||
@@ -1089,7 +1105,7 @@
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/passenger/proc/move_inside(var/mob/user)
|
||||
if (chassis)
|
||||
chassis.visible_message("\blue [user] starts to climb into [chassis].")
|
||||
chassis.visible_message("<span class='notice'>[user] starts to climb into [chassis].</span>")
|
||||
|
||||
if(do_after(user, 40, needhand=0))
|
||||
if(!src.occupant)
|
||||
@@ -1098,7 +1114,7 @@
|
||||
log_message("[user] boarded.")
|
||||
occupant_message("[user] boarded.")
|
||||
else if(src.occupant != user)
|
||||
user << "\red [src.occupant] was faster. Try better next time, loser."
|
||||
user << "<span class='warning'>[src.occupant] was faster. Try better next time, loser.</span>"
|
||||
else
|
||||
user << "You stop entering the exosuit."
|
||||
|
||||
@@ -1173,18 +1189,18 @@
|
||||
return
|
||||
|
||||
if (!isturf(usr.loc))
|
||||
usr << "\red You can't reach the passenger compartment from here."
|
||||
usr << "<span class='danger'>You can't reach the passenger compartment from here.</span>"
|
||||
return
|
||||
|
||||
if(iscarbon(usr))
|
||||
var/mob/living/carbon/C = usr
|
||||
if(C.handcuffed)
|
||||
usr << "\red Kinda hard to climb in while handcuffed don't you think?"
|
||||
usr << "<span class='danger'>Kinda hard to climb in while handcuffed don't you think?</span>"
|
||||
return
|
||||
|
||||
for(var/mob/living/carbon/slime/M in range(1,usr))
|
||||
if(M.Victim == usr)
|
||||
usr << "\red You're too busy getting your life sucked out of you."
|
||||
usr << "<span class='danger'>You're too busy getting your life sucked out of you.</span>"
|
||||
return
|
||||
|
||||
//search for a valid passenger compartment
|
||||
@@ -1204,10 +1220,10 @@
|
||||
//didn't find anything
|
||||
switch (feedback)
|
||||
if (OCCUPIED)
|
||||
usr << "\red The passenger compartment is already occupied!"
|
||||
usr << "<span class='danger'>The passenger compartment is already occupied!</span>"
|
||||
if (LOCKED)
|
||||
usr << "\red The passenger compartment hatch is locked!"
|
||||
usr << "<span class='warning'>The passenger compartment hatch is locked!</span>"
|
||||
if (OCCUPIED|LOCKED)
|
||||
usr << "\red All of the passenger compartments are already occupied or locked!"
|
||||
usr << "<span class='danger'>All of the passenger compartments are already occupied or locked!</span>"
|
||||
if (0)
|
||||
usr << "\red \The [src] doesn't have a passenger compartment."
|
||||
usr << "<span class='warning'>\The [src] doesn't have a passenger compartment.</span>"
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
A.bullet_act(src, def_zone)
|
||||
src.life -= 10
|
||||
if(life <= 0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/energy/taser
|
||||
@@ -249,7 +249,7 @@
|
||||
throw_impact(atom/hit_atom)
|
||||
if(primed)
|
||||
explosion(hit_atom, 0, 1, 2, 4)
|
||||
del(src)
|
||||
qdel(src)
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -193,9 +193,9 @@
|
||||
if(time_coeff!=diff)
|
||||
time_coeff = diff
|
||||
|
||||
/obj/machinery/mecha_part_fabricator/Del()
|
||||
/obj/machinery/mecha_part_fabricator/Destroy()
|
||||
for(var/atom/A in src)
|
||||
del A
|
||||
qdel(A)
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
if(!istype(apart)) return 0
|
||||
for(var/obj/O in part_set)
|
||||
if(O.type == apart.type)
|
||||
del apart
|
||||
qdel(apart)
|
||||
return 0
|
||||
part_set[++part_set.len] = apart
|
||||
return 1
|
||||
@@ -749,7 +749,7 @@
|
||||
res.Move(src.loc)
|
||||
result = res.amount
|
||||
else
|
||||
del res
|
||||
qdel(res)
|
||||
return result
|
||||
|
||||
|
||||
@@ -795,7 +795,7 @@
|
||||
if(src.resources["diamond"] >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond(src.loc)
|
||||
G.amount = round(src.resources["diamond"] / G.perunit)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return 1
|
||||
else
|
||||
user << "\red You can't load the [src.name] while it's opened."
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
/obj/mecha/New()
|
||||
..()
|
||||
events = new
|
||||
|
||||
icon_state += "-open"
|
||||
add_radio()
|
||||
add_cabin()
|
||||
@@ -98,11 +99,60 @@
|
||||
mechas_list += src //global mech list
|
||||
return
|
||||
|
||||
/obj/mecha/Del()
|
||||
/obj/mecha/Destroy()
|
||||
src.go_out()
|
||||
for(var/mob/M in src) //Let's just be ultra sure
|
||||
M.Move(loc)
|
||||
|
||||
if(loc)
|
||||
loc.Exited(src)
|
||||
loc = null
|
||||
|
||||
if(prob(30))
|
||||
explosion(get_turf(loc), 0, 0, 1, 3)
|
||||
|
||||
if(wreckage)
|
||||
var/obj/effect/decal/mecha_wreckage/WR = new wreckage(loc)
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/E in equipment)
|
||||
if(E.salvageable && prob(30))
|
||||
WR.crowbar_salvage += E
|
||||
E.forceMove(WR)
|
||||
E.equip_ready = 1
|
||||
E.reliability = round(rand(E.reliability/3,E.reliability))
|
||||
else
|
||||
E.forceMove(loc)
|
||||
E.destroy()
|
||||
if(cell)
|
||||
WR.crowbar_salvage += cell
|
||||
cell.forceMove(WR)
|
||||
cell.charge = rand(0, cell.charge)
|
||||
if(internal_tank)
|
||||
WR.crowbar_salvage += internal_tank
|
||||
internal_tank.forceMove(WR)
|
||||
else
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/E in equipment)
|
||||
E.detach(loc)
|
||||
E.destroy()
|
||||
if(cell)
|
||||
qdel(cell)
|
||||
if(internal_tank)
|
||||
qdel(internal_tank)
|
||||
equipment.Cut()
|
||||
cell = null
|
||||
internal_tank = null
|
||||
|
||||
qdel(pr_int_temp_processor)
|
||||
qdel(pr_inertial_movement)
|
||||
qdel(pr_give_air)
|
||||
qdel(pr_internal_damage)
|
||||
qdel(spark_system)
|
||||
pr_int_temp_processor = null
|
||||
pr_give_air = null
|
||||
pr_internal_damage = null
|
||||
spark_system = null
|
||||
|
||||
mechas_list -= src //global mech list
|
||||
..()
|
||||
return
|
||||
|
||||
////////////////////////
|
||||
////// Helpers /////////
|
||||
@@ -447,12 +497,17 @@
|
||||
/obj/mecha/proc/dynabsorbdamage(damage,damage_type)
|
||||
return damage*(listgetindex(damage_absorption,damage_type) || 1)
|
||||
|
||||
/obj/mecha/airlock_crush(var/crush_damage)
|
||||
..()
|
||||
take_damage(crush_damage)
|
||||
check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
|
||||
return 1
|
||||
|
||||
/obj/mecha/proc/update_health()
|
||||
if(src.health > 0)
|
||||
src.spark_system.start()
|
||||
else
|
||||
src.destroy()
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/mecha/attack_hand(mob/user as mob)
|
||||
@@ -555,52 +610,6 @@
|
||||
Proj.on_hit(src)
|
||||
return
|
||||
|
||||
/obj/mecha/proc/destroy()
|
||||
spawn()
|
||||
go_out()
|
||||
var/turf/T = get_turf(src)
|
||||
tag = "\ref[src]" //better safe then sorry
|
||||
if(loc)
|
||||
loc.Exited(src)
|
||||
loc = null
|
||||
if(T)
|
||||
if(istype(src, /obj/mecha/working/ripley/))
|
||||
var/obj/mecha/working/ripley/R = src
|
||||
if(R.cargo)
|
||||
for(var/obj/O in R.cargo) //Dump contents of stored cargo
|
||||
O.loc = T
|
||||
R.cargo -= O
|
||||
T.Entered(O)
|
||||
|
||||
if(prob(30))
|
||||
explosion(T, 0, 0, 1, 3)
|
||||
spawn(0)
|
||||
if(wreckage)
|
||||
var/obj/effect/decal/mecha_wreckage/WR = new wreckage(T)
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/E in equipment)
|
||||
if(E.salvageable && prob(30))
|
||||
WR.crowbar_salvage += E
|
||||
E.forceMove(WR)
|
||||
E.equip_ready = 1
|
||||
E.reliability = round(rand(E.reliability/3,E.reliability))
|
||||
else
|
||||
E.forceMove(T)
|
||||
E.destroy()
|
||||
if(cell)
|
||||
WR.crowbar_salvage += cell
|
||||
cell.forceMove(WR)
|
||||
cell.charge = rand(0, cell.charge)
|
||||
if(internal_tank)
|
||||
WR.crowbar_salvage += internal_tank
|
||||
internal_tank.forceMove(WR)
|
||||
else
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/E in equipment)
|
||||
E.forceMove(T)
|
||||
E.destroy()
|
||||
spawn(0)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/mecha/ex_act(severity)
|
||||
src.log_message("Affected by explosion of severity: [severity].",1)
|
||||
if(prob(src.deflect_chance))
|
||||
@@ -608,16 +617,16 @@
|
||||
src.log_append_to_last("Armor saved, changing severity to [severity].")
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
src.destroy()
|
||||
qdel(src)
|
||||
if(2.0)
|
||||
if (prob(30))
|
||||
src.destroy()
|
||||
qdel(src)
|
||||
else
|
||||
src.take_damage(initial(src.health)/2)
|
||||
src.check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT),1)
|
||||
if(3.0)
|
||||
if (prob(5))
|
||||
src.destroy()
|
||||
qdel(src)
|
||||
else
|
||||
src.take_damage(initial(src.health)/5)
|
||||
src.check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT),1)
|
||||
@@ -831,7 +840,7 @@
|
||||
src.reset_icon()
|
||||
|
||||
user.drop_item()
|
||||
del(P)
|
||||
qdel(P)
|
||||
|
||||
else
|
||||
call((proc_res["dynattackby"]||src), "dynattackby")(W,user)
|
||||
@@ -1732,7 +1741,7 @@
|
||||
AI.bruteloss = O.getBruteLoss()
|
||||
AI.toxloss = O.toxloss
|
||||
AI.updatehealth()
|
||||
del(O)
|
||||
qdel(O)
|
||||
if (!AI.stat)
|
||||
AI.icon_state = "ai"
|
||||
else
|
||||
@@ -1840,7 +1849,7 @@
|
||||
if(t_air)
|
||||
t_air.merge(removed)
|
||||
else //just delete the cabin gas, we're in space or some shit
|
||||
del(removed)
|
||||
qdel(removed)
|
||||
else
|
||||
return stop()
|
||||
return
|
||||
@@ -1883,7 +1892,7 @@
|
||||
if(mecha.loc && hascall(mecha.loc,"assume_air"))
|
||||
mecha.loc.assume_air(leaked_gas)
|
||||
else
|
||||
del(leaked_gas)
|
||||
qdel(leaked_gas)
|
||||
if(mecha.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT))
|
||||
if(mecha.get_charge())
|
||||
mecha.spark_system.start()
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
custom_action(step, atom/used_atom, mob/user)
|
||||
user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
|
||||
holder.overlays += used_atom.icon_state+"+o"
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
return 1
|
||||
|
||||
action(atom/used_atom,mob/user as mob)
|
||||
@@ -92,7 +92,7 @@
|
||||
const_holder.density = 1
|
||||
const_holder.overlays.len = 0
|
||||
spawn()
|
||||
del src
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
if(10)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "ripley5"
|
||||
else
|
||||
user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
|
||||
@@ -210,7 +210,7 @@
|
||||
if(8)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "ripley7"
|
||||
else
|
||||
user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
|
||||
@@ -289,7 +289,7 @@
|
||||
custom_action(step, atom/used_atom, mob/user)
|
||||
user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
|
||||
holder.overlays += used_atom.icon_state+"+o"
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
return 1
|
||||
|
||||
action(atom/used_atom,mob/user as mob)
|
||||
@@ -302,7 +302,7 @@
|
||||
const_holder.icon_state = "gygax0"
|
||||
const_holder.density = 1
|
||||
spawn()
|
||||
del src
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
@@ -428,7 +428,7 @@
|
||||
if(16)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "gygax5"
|
||||
else
|
||||
user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
|
||||
@@ -444,7 +444,7 @@
|
||||
if(14)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "gygax7"
|
||||
else
|
||||
user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
|
||||
@@ -460,7 +460,7 @@
|
||||
if(12)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs the weapon control module into [holder].", "You install the weapon control module into [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "gygax9"
|
||||
else
|
||||
user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
|
||||
@@ -476,7 +476,7 @@
|
||||
if(10)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs advanced scanner module to [holder].", "You install advanced scanner module to [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "gygax11"
|
||||
else
|
||||
user.visible_message("[user] unfastens the weapon control module.", "You unfasten the weapon control module.")
|
||||
@@ -492,7 +492,7 @@
|
||||
if(8)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs advanced capacitor to [holder].", "You install advanced capacitor to [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "gygax13"
|
||||
else
|
||||
user.visible_message("[user] unfastens the advanced scanner module.", "You unfasten the advanced scanner module.")
|
||||
@@ -531,7 +531,7 @@
|
||||
if(3)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs Gygax Armour Plates to [holder].", "You install Gygax Armour Plates to [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "gygax18"
|
||||
else
|
||||
user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].")
|
||||
@@ -570,7 +570,7 @@
|
||||
user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
|
||||
holder.overlays += used_atom.icon_state+"+o"
|
||||
user.drop_item()
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
return 1
|
||||
|
||||
action(atom/used_atom,mob/user as mob)
|
||||
@@ -583,7 +583,7 @@
|
||||
const_holder.icon_state = "fireripley0"
|
||||
const_holder.density = 1
|
||||
spawn()
|
||||
del src
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
@@ -690,7 +690,7 @@
|
||||
if(11)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "fireripley5"
|
||||
else
|
||||
user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
|
||||
@@ -706,7 +706,7 @@
|
||||
if(9)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "fireripley7"
|
||||
else
|
||||
user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
|
||||
@@ -793,7 +793,7 @@
|
||||
custom_action(step, atom/used_atom, mob/user)
|
||||
user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
|
||||
holder.overlays += used_atom.icon_state+"+o"
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
return 1
|
||||
|
||||
action(atom/used_atom,mob/user as mob)
|
||||
@@ -806,7 +806,7 @@
|
||||
const_holder.icon_state = "durand0"
|
||||
const_holder.density = 1
|
||||
spawn()
|
||||
del src
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/datum/construction/reversible/mecha/durand
|
||||
@@ -932,7 +932,7 @@
|
||||
if(16)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "durand5"
|
||||
else
|
||||
user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
|
||||
@@ -948,7 +948,7 @@
|
||||
if(14)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "durand7"
|
||||
else
|
||||
user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
|
||||
@@ -964,7 +964,7 @@
|
||||
if(12)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs the weapon control module into [holder].", "You install the weapon control module into [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "durand9"
|
||||
else
|
||||
user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
|
||||
@@ -980,7 +980,7 @@
|
||||
if(10)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs advanced scanner module to [holder].", "You install advanced scanner module to [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "durand11"
|
||||
else
|
||||
user.visible_message("[user] unfastens the weapon control module.", "You unfasten the weapon control module.")
|
||||
@@ -996,7 +996,7 @@
|
||||
if(8)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs advanced capacitor to [holder].", "You install advanced capacitor to [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "durand13"
|
||||
else
|
||||
user.visible_message("[user] unfastens the advanced scanner module.", "You unfasten the advanced scanner module.")
|
||||
@@ -1035,7 +1035,7 @@
|
||||
if(3)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs Durand Armour Plates to [holder].", "You install Durand Armour Plates to [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "durand18"
|
||||
else
|
||||
user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].")
|
||||
@@ -1075,7 +1075,7 @@
|
||||
custom_action(step, atom/used_atom, mob/user)
|
||||
user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
|
||||
holder.overlays += used_atom.icon_state+"+o"
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
return 1
|
||||
|
||||
action(atom/used_atom,mob/user as mob)
|
||||
@@ -1096,7 +1096,7 @@
|
||||
custom_action(step, atom/used_atom, mob/user)
|
||||
user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
|
||||
holder.overlays += used_atom.icon_state+"+o"
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
return 1
|
||||
|
||||
action(atom/used_atom,mob/user as mob)
|
||||
@@ -1109,7 +1109,7 @@
|
||||
const_holder.icon_state = "odysseus0"
|
||||
const_holder.density = 1
|
||||
spawn()
|
||||
del src
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
@@ -1211,7 +1211,7 @@
|
||||
if(10)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "odysseus5"
|
||||
else
|
||||
user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
|
||||
@@ -1227,7 +1227,7 @@
|
||||
if(8)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
|
||||
del used_atom
|
||||
qdel(used_atom)
|
||||
holder.icon_state = "odysseus7"
|
||||
else
|
||||
user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
|
||||
|
||||
@@ -90,11 +90,11 @@
|
||||
return answer
|
||||
|
||||
emp_act()
|
||||
del src
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
ex_act()
|
||||
del src
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
proc/in_mecha()
|
||||
@@ -106,7 +106,7 @@
|
||||
var/obj/mecha/M = in_mecha()
|
||||
if(M)
|
||||
M.emp_act(2)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
proc/get_mecha_log()
|
||||
if(!src.in_mecha())
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
/obj/effect/decal/mecha_wreckage/ex_act(severity)
|
||||
if(severity < 2)
|
||||
spawn
|
||||
del src
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/effect/decal/mecha_wreckage/bullet_act(var/obj/item/projectile/Proj)
|
||||
|
||||
@@ -9,6 +9,16 @@
|
||||
wreckage = /obj/effect/decal/mecha_wreckage/ripley
|
||||
cargo_capacity = 10
|
||||
|
||||
/obj/mecha/working/ripley/Destroy()
|
||||
for(var/atom/movable/A in src.cargo)
|
||||
A.loc = loc
|
||||
var/turf/T = loc
|
||||
if(istype(T))
|
||||
T.Entered(A)
|
||||
step_rand(A)
|
||||
cargo.Cut()
|
||||
..()
|
||||
|
||||
/obj/mecha/working/ripley/firefighter
|
||||
desc = "Standart APLU chassis was refitted with additional thermal protection and cistern."
|
||||
name = "APLU \"Firefighter\""
|
||||
@@ -54,6 +64,6 @@
|
||||
var/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp/HC = new /obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp
|
||||
HC.attach(src)
|
||||
for(var/obj/item/mecha_parts/mecha_tracking/B in src.contents)//Deletes the beacon so it can't be found easily
|
||||
del (B)
|
||||
qdel (B)
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
new /obj/item/mecha_parts/mecha_tracking(src)
|
||||
return
|
||||
|
||||
/obj/mecha/working/Del()
|
||||
/obj/mecha/working/Destroy()
|
||||
for(var/mob/M in src)
|
||||
if(M==src.occupant)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user