mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 20:45:28 +01:00
- Mech equipment was using its unique processing method, with specific timing for each equipment, but now it uses obj processing, I
changed the values so the equipment effect stays the same. Remove global_iterator datum. - fiddled with equip_ready procs of mech tools. - removed mecha/proc/do_after and /enter_after() procs. - Renamed mech sleeper occupant var to "patient" to avoid confusion with the occupant of the mech. - all non instant tool (drill) now show a progbar when drilling etc.. - action cooldown now use do_after_cooldown() (that itself uses do_after) and start_cooldown (for instantaneous actions). - Removed mecha_equipment's destroy proc, it's now all in Destroy(). No confusion. - modified mecha_equipment/proc/can_attach() to not check istype(mecha) b/c it can't not be. (so the child only have one istype check. - Removed diamonddrill/can_attach() , all done at drill level. - armor booster now only for combat mech, instead of all except honkmech. - Removed dynhitby, dynbulletdamage, dynattackby, dynusepower(), dyngetcharge(), dynabsorbdamage() - I split the tools.dm file into smaller ones: work tools, mining tools, other tools. - I split mecha.dm into mecha.dm, mecha_topic.dm and mecha_defense.dm - refactored mech weapon ballistic/launcher, new proj_init proc, more OOP. - Moving consumes energy! Lights consumes energy. Fixes #9425. - Fixed #7354 xeno not bursting if host is inside a mech. - Added action buttons to mech. Moved toggle lights, internal tank, eject, view stats from verbs to action buttons, these can now only be done via these buttons (removed them from the big stats window). - Removed port connect verbs b/C it's automated now. - regular hud is no longer hidden when inside a mech (doesn't matter b/c you can't interact with most stuff in it while in a mecha). Fixes issue 10387 - can't walk when shooting projectiles. Makes walking on your projectile a bit harder. Helps against issue 10315 (but doesn't fix it). - also made into action buttons: the special abilities of certain combat mechs. - Added thrown alerts for mech charge and integrity. - Fixes teleporting occupant out not properly removing it from the mech. Fixes issue 10330 - fixes ballistic mech weapons spinning when launched. proc/throw_at() now has a spin argument instead of using var/allow_spin that was added to all atoms just for that. - added a update_action_buttons() to ai/life() to handle ai mech.
This commit is contained in:
@@ -228,6 +228,13 @@ office by your AI master or any qualified human may resolve this matter. Robotic
|
||||
so as to remain in compliance with the most up-to-date laws."
|
||||
timeout = 300
|
||||
|
||||
//MECHS
|
||||
|
||||
/obj/screen/alert/low_mech_integrity
|
||||
name = "Mech Damaged"
|
||||
desc = "Mech integrity is low."
|
||||
|
||||
|
||||
//OBJECT-BASED
|
||||
|
||||
/obj/screen/alert/buckled
|
||||
|
||||
@@ -198,8 +198,6 @@ var/datum/global_hud/global_hud = new()
|
||||
else if(isdrone(mymob))
|
||||
drone_hud(ui_style)
|
||||
|
||||
if(istype(mymob.loc,/obj/mecha) && ishuman(mymob))
|
||||
show_hud(HUD_STYLE_REDUCED)
|
||||
|
||||
//Version denotes which style should be displayed. blank or 0 means "next version"
|
||||
/datum/hud/proc/show_hud(var/version = 0)
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
/*
|
||||
README:
|
||||
|
||||
The global_iterator datum is supposed to provide a simple and robust way to
|
||||
create some constantly "looping" processes with ability to stop and restart them at will.
|
||||
Generally, the only thing you want to play with (meaning, redefine) is the process() proc.
|
||||
It must contain all the things you want done.
|
||||
|
||||
Control functions:
|
||||
new - used to create datum. First argument (optional) - var list(to use in process() proc) as list,
|
||||
second (optional) - autostart control.
|
||||
If autostart == TRUE, the loop will be started immediately after datum creation.
|
||||
|
||||
start(list/arguments) - starts the loop. Takes arguments(optional) as a list, which is then used
|
||||
by process() proc. Returns null if datum already active, 1 if loop started successfully and 0 if there's
|
||||
an error in supplied arguments (not list or empty list).
|
||||
|
||||
stop() - stops the loop. Returns null if datum is already inactive and 1 on success.
|
||||
|
||||
set_delay(new_delay) - sets the delay between iterations. Pretty selfexplanatory.
|
||||
Returns 0 on error(new_delay is not numerical), 1 otherwise.
|
||||
|
||||
set_process_args(list/arguments) - passes the supplied arguments to the process() proc.
|
||||
|
||||
active() - Returns 1 if datum is active, 0 otherwise.
|
||||
|
||||
toggle() - toggles datum state. Returns new datum state (see active()).
|
||||
|
||||
Misc functions:
|
||||
|
||||
get_last_exec_time() - Returns the time of last iteration.
|
||||
|
||||
get_last_exec_time_as_text() - Returns the time of last iteration as text
|
||||
|
||||
|
||||
Control vars:
|
||||
|
||||
delay - delay between iterations
|
||||
|
||||
check_for_null - if equals TRUE, on each iteration the supplied arguments will be checked for nulls.
|
||||
If some varible equals null (and null only), the loop is stopped.
|
||||
Usefull, if some var unexpectedly becomes null - due to object deletion, for example.
|
||||
Of course, you can also check the variables inside process() proc to prevent runtime errors.
|
||||
|
||||
Data storage vars:
|
||||
|
||||
result - stores the value returned by process() proc
|
||||
*/
|
||||
|
||||
/datum/global_iterator
|
||||
var/control_switch = 0
|
||||
var/delay = 10
|
||||
var/list/arg_list = new
|
||||
var/last_exec = null
|
||||
var/check_for_null = 1
|
||||
var/forbid_garbage = 0
|
||||
var/result
|
||||
var/state = 0
|
||||
|
||||
/datum/global_iterator/New(list/arguments=null,autostart=1)
|
||||
delay = delay>0?(delay):1
|
||||
if(forbid_garbage) //prevents garbage collection with tag != null
|
||||
tag = "\ref[src]"
|
||||
set_process_args(arguments)
|
||||
if(autostart)
|
||||
start()
|
||||
return
|
||||
|
||||
/datum/global_iterator/Destroy()
|
||||
tag = null
|
||||
arg_list.Cut()
|
||||
stop()
|
||||
//Do not call ..()
|
||||
|
||||
/datum/global_iterator/proc/main()
|
||||
state = 1
|
||||
while(src && control_switch)
|
||||
last_exec = world.timeofday
|
||||
if(check_for_null && has_null_args())
|
||||
stop()
|
||||
return 0
|
||||
result = process(arglist(arg_list))
|
||||
for(var/sleep_time=delay;sleep_time>0;sleep_time--) //uhh, this is ugly. But I see no other way to terminate sleeping proc. Such disgrace.
|
||||
if(!control_switch)
|
||||
return 0
|
||||
sleep(1)
|
||||
return 0
|
||||
|
||||
/datum/global_iterator/proc/start(list/arguments=null)
|
||||
if(active())
|
||||
return
|
||||
if(arguments)
|
||||
if(!set_process_args(arguments))
|
||||
return 0
|
||||
if(!state_check()) //the main loop is sleeping, wait for it to terminate.
|
||||
return
|
||||
control_switch = 1
|
||||
spawn()
|
||||
state = main()
|
||||
return 1
|
||||
|
||||
/datum/global_iterator/proc/stop()
|
||||
if(!active())
|
||||
return
|
||||
control_switch = 0
|
||||
spawn(-1) //report termination error but don't wait for state_check().
|
||||
state_check()
|
||||
return 1
|
||||
|
||||
/datum/global_iterator/proc/state_check()
|
||||
var/lag = 0
|
||||
while(state)
|
||||
sleep(1)
|
||||
if(++lag>10)
|
||||
CRASH("The global_iterator loop \ref[src] failed to terminate in designated timeframe. This may be caused by server lagging.")
|
||||
return 1
|
||||
|
||||
/datum/global_iterator/process()
|
||||
return
|
||||
|
||||
/datum/global_iterator/proc/active()
|
||||
return control_switch
|
||||
|
||||
/datum/global_iterator/proc/has_null_args()
|
||||
if(null in arg_list)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/datum/global_iterator/proc/set_delay(new_delay)
|
||||
if(isnum(new_delay))
|
||||
delay = max(1, round(new_delay))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/datum/global_iterator/proc/get_last_exec_time()
|
||||
return (last_exec||0)
|
||||
|
||||
/datum/global_iterator/proc/get_last_exec_time_as_text()
|
||||
return (time2text(last_exec)||"Wasn't executed yet")
|
||||
|
||||
/datum/global_iterator/proc/set_process_args(list/arguments)
|
||||
if(arguments && istype(arguments, /list) && arguments.len)
|
||||
arg_list = arguments
|
||||
return 1
|
||||
else
|
||||
// world << "\red Invalid arguments supplied for [src.type], ref = \ref[src]"
|
||||
return 0
|
||||
|
||||
/datum/global_iterator/proc/toggle_null_checks()
|
||||
check_for_null = !check_for_null
|
||||
return check_for_null
|
||||
|
||||
/datum/global_iterator/proc/toggle()
|
||||
if(!stop())
|
||||
start()
|
||||
return active()
|
||||
|
||||
|
||||
@@ -17,11 +17,6 @@
|
||||
//HUD images that this atom can provide.
|
||||
var/list/hud_possible
|
||||
|
||||
//var/chem_is_open_container = 0
|
||||
// replaced by OPENCONTAINER flags and atom/proc/is_open_container()
|
||||
///Chemistry.
|
||||
var/allow_spin = 1
|
||||
|
||||
//Value used to increment ex_act() if reactionary_explosions is on
|
||||
var/explosion_block = 0
|
||||
|
||||
|
||||
@@ -168,12 +168,12 @@
|
||||
src.throw_impact(A)
|
||||
src.throwing = 0
|
||||
|
||||
/atom/movable/proc/throw_at(atom/target, range, speed, mob/thrower)
|
||||
/atom/movable/proc/throw_at(atom/target, range, speed, mob/thrower, var/spin = 1)
|
||||
if(!target || !src || (flags & NODROP)) return 0
|
||||
//use a modified version of Bresenham's algorithm to get from the atom's current position to that of the target
|
||||
|
||||
src.throwing = 1
|
||||
if(target.allow_spin) // turns out 1000+ spinning objects being thrown at the singularity creates lag - Iamgoofball
|
||||
if(spin) // turns out 1000+ spinning objects being thrown at the singularity creates lag - Iamgoofball
|
||||
SpinAnimation(5, 1)
|
||||
var/dist_x = abs(target.x - src.x)
|
||||
var/dist_y = abs(target.y - src.y)
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
rcdmod.uses --
|
||||
for(var/obj/item/weapon/rcd/rcd in world)
|
||||
rcd.disabled = 1
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/tool/rcd/rcd in world)
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/rcd/rcd in world)
|
||||
rcd.disabled = 1
|
||||
src << "<span class='warning>RCD-disabling pulse emitted.</span>"
|
||||
else src << "<span class='notice'>Out of uses.</span>"
|
||||
|
||||
@@ -13,15 +13,7 @@
|
||||
var/defence = 0
|
||||
var/defence_deflect = 35
|
||||
wreckage = /obj/structure/mecha_wreckage/durand
|
||||
|
||||
/*
|
||||
/obj/mecha/combat/durand/New()
|
||||
..()
|
||||
weapons += new /datum/mecha_weapon/ballistic/lmg(src)
|
||||
weapons += new /datum/mecha_weapon/ballistic/scattershot(src)
|
||||
selected_weapon = weapons[1]
|
||||
return
|
||||
*/
|
||||
var/datum/action/mecha/mech_defence_mode/defense_action = new
|
||||
|
||||
/obj/mecha/combat/durand/relaymove(mob/user,direction)
|
||||
if(defence)
|
||||
@@ -32,43 +24,33 @@
|
||||
. = ..()
|
||||
return
|
||||
|
||||
/obj/mecha/combat/durand/GrantActions(var/mob/living/user, var/human_occupant = 0)
|
||||
..()
|
||||
defense_action.chassis = src
|
||||
defense_action.Grant(user)
|
||||
|
||||
/obj/mecha/combat/durand/verb/defence_mode()
|
||||
set category = "Exosuit Interface"
|
||||
set name = "Toggle defence mode"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
if(!can_use(usr))
|
||||
return
|
||||
defence = !defence
|
||||
if(defence)
|
||||
deflect_chance = defence_deflect
|
||||
src.occupant_message("<span class='notice'>You enable [src] defence mode.</span>")
|
||||
else
|
||||
deflect_chance = initial(deflect_chance)
|
||||
src.occupant_message("<span class='danger'>You disable [src] defence mode.</span>")
|
||||
src.log_message("Toggled defence mode.")
|
||||
return
|
||||
|
||||
/obj/mecha/combat/durand/RemoveActions(var/mob/living/user, var/human_occupant = 0)
|
||||
..()
|
||||
defense_action.Remove(user)
|
||||
|
||||
/obj/mecha/combat/durand/get_stats_part()
|
||||
var/output = ..()
|
||||
output += "<b>Defence mode: [defence?"on":"off"]</b>"
|
||||
return output
|
||||
|
||||
/obj/mecha/combat/durand/get_commands()
|
||||
var/output = {"<div class='wr'>
|
||||
<div class='header'>Special</div>
|
||||
<div class='links'>
|
||||
<a href='?src=\ref[src];toggle_defence_mode=1'>Toggle defence mode</a>
|
||||
</div>
|
||||
</div>
|
||||
"}
|
||||
output += ..()
|
||||
return output
|
||||
/datum/action/mecha/mech_defence_mode
|
||||
name = "Toggle Defense Mode"
|
||||
button_icon_state = "mech_toggle_defense_mode"
|
||||
|
||||
/obj/mecha/combat/durand/Topic(href, href_list)
|
||||
..()
|
||||
if (href_list["toggle_defence_mode"])
|
||||
src.defence_mode()
|
||||
return
|
||||
/datum/action/mecha/mech_defence_mode/Activate()
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
return
|
||||
var/obj/mecha/combat/durand/D = chassis
|
||||
D.defence = !D.defence
|
||||
if(D.defence)
|
||||
D.deflect_chance = D.defence_deflect
|
||||
D.occupant_message("<span class='notice'>You enable [D] defence mode.</span>")
|
||||
else
|
||||
D.deflect_chance = initial(D.deflect_chance)
|
||||
D.occupant_message("<span class='danger'>You disable [D] defence mode.</span>")
|
||||
D.log_message("Toggled defence mode.")
|
||||
@@ -33,7 +33,7 @@
|
||||
..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/carbine
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/flashbang
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/teleporter
|
||||
ME.attach(src)
|
||||
@@ -71,16 +71,16 @@
|
||||
src.log_message("Toggled leg actuators overload.")
|
||||
return
|
||||
|
||||
/obj/mecha/combat/gygax/dyndomove(direction)
|
||||
if(!..()) return
|
||||
/obj/mecha/combat/gygax/domove(direction)
|
||||
if(!..())
|
||||
return
|
||||
if(overload)
|
||||
health--
|
||||
if(health < initial(health) - initial(health)/3)
|
||||
overload = 0
|
||||
step_in = initial(step_in)
|
||||
step_energy_drain = initial(step_energy_drain)
|
||||
src.occupant_message("<span class='danger'>Leg actuators damage threshold exceded. Disabling overload.</span>")
|
||||
return
|
||||
occupant_message("<span class='danger'>Leg actuators damage threshold exceded. Disabling overload.</span>")
|
||||
|
||||
|
||||
/obj/mecha/combat/gygax/get_stats_part()
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
internal_damage_threshold = 25
|
||||
force = 45
|
||||
max_equip = 4
|
||||
var/datum/action/mecha/mech_smoke/smoke_action = new
|
||||
var/datum/action/mecha/mech_toggle_thrusters/thrusters_action = new
|
||||
var/datum/action/mecha/mech_zoom/zoom_action = new
|
||||
|
||||
/obj/mecha/combat/marauder/Destroy()
|
||||
qdel(smoke_system)
|
||||
@@ -51,7 +54,7 @@
|
||||
ME.attach(src)
|
||||
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(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/missile_rack(src)
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/tesla_energy_relay(src)
|
||||
ME.attach(src)
|
||||
@@ -65,7 +68,7 @@
|
||||
..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/energy/pulse(src)
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/missile_rack(src)
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/tesla_energy_relay(src)
|
||||
ME.attach(src)
|
||||
@@ -84,7 +87,7 @@
|
||||
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(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/missile_rack(src)
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/teleporter(src)
|
||||
ME.attach(src)
|
||||
@@ -110,54 +113,23 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/mecha/combat/marauder/verb/toggle_thrusters()
|
||||
set category = "Exosuit Interface"
|
||||
set name = "Toggle thrusters"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
if(usr!=src.occupant)
|
||||
return
|
||||
if(src.occupant)
|
||||
if(get_charge() > 0)
|
||||
thrusters = !thrusters
|
||||
src.log_message("Toggled thrusters.")
|
||||
src.occupant_message("<font color='[src.thrusters?"blue":"red"]'>Thrusters [thrusters?"en":"dis"]abled.")
|
||||
return
|
||||
|
||||
/obj/mecha/combat/marauder/GrantActions(var/mob/living/user, var/human_occupant = 0)
|
||||
..()
|
||||
smoke_action.chassis = src
|
||||
smoke_action.Grant(user)
|
||||
|
||||
/obj/mecha/combat/marauder/verb/smoke()
|
||||
set category = "Exosuit Interface"
|
||||
set name = "Smoke"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
if(usr!=src.occupant)
|
||||
return
|
||||
if(smoke_ready && smoke>0)
|
||||
src.smoke_system.start()
|
||||
smoke--
|
||||
smoke_ready = 0
|
||||
spawn(smoke_cooldown)
|
||||
smoke_ready = 1
|
||||
return
|
||||
thrusters_action.chassis = src
|
||||
thrusters_action.Grant(user)
|
||||
|
||||
/obj/mecha/combat/marauder/verb/zoom()
|
||||
set category = "Exosuit Interface"
|
||||
set name = "Zoom"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
if(usr!=src.occupant)
|
||||
return
|
||||
if(src.occupant.client)
|
||||
src.zoom = !src.zoom
|
||||
src.log_message("Toggled zoom mode.")
|
||||
src.occupant_message("<font color='[src.zoom?"blue":"red"]'>Zoom mode [zoom?"en":"dis"]abled.</font>")
|
||||
if(zoom)
|
||||
src.occupant.client.view = 12
|
||||
src.occupant << sound('sound/mecha/imag_enh.ogg',volume=50)
|
||||
else
|
||||
src.occupant.client.view = world.view//world.view - default mob view size
|
||||
return
|
||||
zoom_action.chassis = src
|
||||
zoom_action.Grant(user)
|
||||
|
||||
/obj/mecha/combat/marauder/RemoveActions(var/mob/living/user, var/human_occupant = 0)
|
||||
..()
|
||||
smoke_action.Remove(user)
|
||||
thrusters_action.Remove(user)
|
||||
zoom_action.Remove(user)
|
||||
|
||||
/obj/mecha/combat/marauder/go_out()
|
||||
if(src.occupant && src.occupant.client)
|
||||
@@ -176,25 +148,53 @@
|
||||
return output
|
||||
|
||||
|
||||
/obj/mecha/combat/marauder/get_commands()
|
||||
var/output = {"<div class='wr'>
|
||||
<div class='header'>Special</div>
|
||||
<div class='links'>
|
||||
<a href='?src=\ref[src];toggle_thrusters=1'>Toggle thrusters</a><br>
|
||||
<a href='?src=\ref[src];toggle_zoom=1'>Toggle zoom mode</a><br>
|
||||
<a href='?src=\ref[src];smoke=1'>Smoke</a>
|
||||
</div>
|
||||
</div>
|
||||
"}
|
||||
output += ..()
|
||||
return output
|
||||
/datum/action/mecha/mech_smoke
|
||||
name = "Smoke"
|
||||
button_icon_state = "smoke"
|
||||
|
||||
/obj/mecha/combat/marauder/Topic(href, href_list)
|
||||
..()
|
||||
if (href_list["toggle_thrusters"])
|
||||
src.toggle_thrusters()
|
||||
if (href_list["smoke"])
|
||||
src.smoke()
|
||||
if (href_list["toggle_zoom"])
|
||||
src.zoom()
|
||||
return
|
||||
/datum/action/mecha/mech_smoke/Activate()
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
return
|
||||
var/obj/mecha/combat/marauder/M = chassis
|
||||
if(M.smoke_ready && M.smoke>0)
|
||||
M.smoke_system.start()
|
||||
M.smoke--
|
||||
M.smoke_ready = 0
|
||||
spawn(M.smoke_cooldown)
|
||||
M.smoke_ready = 1
|
||||
|
||||
|
||||
/datum/action/mecha/mech_toggle_thrusters
|
||||
name = "Toggle Thrusters"
|
||||
button_icon_state = "mech_toggle_thrusters"
|
||||
|
||||
/datum/action/mecha/mech_toggle_thrusters/Activate()
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
return
|
||||
var/obj/mecha/combat/marauder/M = chassis
|
||||
if(M.get_charge() > 0)
|
||||
M.thrusters = !M.thrusters
|
||||
if(M.thrusters)
|
||||
button_icon_state = "mech_toggle_thrusters_on"
|
||||
else
|
||||
button_icon_state = "mech_toggle_thrusters"
|
||||
M.log_message("Toggled thrusters.")
|
||||
M.occupant_message("<font color='[M.thrusters?"blue":"red"]'>Thrusters [M.thrusters?"en":"dis"]abled.")
|
||||
|
||||
/datum/action/mecha/mech_zoom
|
||||
name = "Zoom"
|
||||
button_icon_state = "mech_zoom"
|
||||
|
||||
/datum/action/mecha/mech_zoom/Activate()
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
return
|
||||
var/obj/mecha/combat/marauder/M = chassis
|
||||
if(owner.client)
|
||||
M.zoom = !M.zoom
|
||||
M.log_message("Toggled zoom mode.")
|
||||
M.occupant_message("<font color='[M.zoom?"blue":"red"]'>Zoom mode [M.zoom?"en":"dis"]abled.</font>")
|
||||
if(M.zoom)
|
||||
owner.client.view = 12
|
||||
owner << sound('sound/mecha/imag_enh.ogg',volume=50)
|
||||
else
|
||||
owner.client.view = world.view//world.view - default mob view size
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
var/phasing = 0
|
||||
var/phasing_energy_drain = 200
|
||||
max_equip = 3
|
||||
var/datum/action/mecha/mech_switch_damtype/switch_damtype_action = new
|
||||
var/datum/action/mecha/mech_toggle_phasing/phasing_action = new
|
||||
|
||||
/obj/mecha/combat/phazon/Bump(var/atom/obstacle)
|
||||
if(phasing && get_charge()>=phasing_energy_drain)
|
||||
@@ -24,8 +26,8 @@
|
||||
if(can_move)
|
||||
can_move = 0
|
||||
flick("phazon-phase", src)
|
||||
src.loc = get_step(src,src.dir)
|
||||
src.use_power(phasing_energy_drain)
|
||||
loc = get_step(src, dir)
|
||||
use_power(phasing_energy_drain)
|
||||
sleep(step_in*3)
|
||||
can_move = 1
|
||||
else
|
||||
@@ -34,50 +36,56 @@
|
||||
|
||||
/obj/mecha/combat/phazon/click_action(atom/target,mob/user)
|
||||
if(phasing)
|
||||
src.occupant_message("Unable to interact with objects while phasing")
|
||||
occupant_message("Unable to interact with objects while phasing")
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/mecha/combat/phazon/verb/switch_damtype()
|
||||
set category = "Exosuit Interface"
|
||||
set name = "Reconfigure arm microtool arrays"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
if(usr!=src.occupant)
|
||||
return
|
||||
var/new_damtype = alert(src.occupant,"Arm tool selection",null,"Fists","Torch","Toxic injector")
|
||||
switch(new_damtype)
|
||||
if("Fists")
|
||||
damtype = "brute"
|
||||
src.occupant_message("Your exosuit's hands form into fists.")
|
||||
if("Torch")
|
||||
damtype = "fire"
|
||||
src.occupant_message("A torch tip extends from your exosuit's hand, glowing red.")
|
||||
if("Toxic injector")
|
||||
damtype = "tox"
|
||||
src.occupant_message("A bone-chillingly thick plasteel needle protracts from the exosuit's palm.")
|
||||
playsound(src, 'sound/mecha/mechmove01.ogg', 50, 1)
|
||||
return
|
||||
|
||||
/obj/mecha/combat/phazon/get_commands()
|
||||
var/output = {"<div class='wr'>
|
||||
<div class='header'>Special</div>
|
||||
<div class='links'>
|
||||
<a href='?src=\ref[src];phasing=1'><span id="phasing_command">[phasing?"Dis":"En"]able phasing</span></a><br>
|
||||
<a href='?src=\ref[src];switch_damtype=1'>Reconfigure arm microtool arrays</a><br>
|
||||
</div>
|
||||
</div>
|
||||
"}
|
||||
output += ..()
|
||||
return output
|
||||
|
||||
/obj/mecha/combat/phazon/Topic(href, href_list)
|
||||
/obj/mecha/combat/phazon/GrantActions(var/mob/living/user, var/human_occupant = 0)
|
||||
..()
|
||||
if (href_list["switch_damtype"])
|
||||
src.switch_damtype()
|
||||
if (href_list["phasing"])
|
||||
phasing = !phasing
|
||||
send_byjax(src.occupant,"exosuit.browser","phasing_command","[phasing?"Dis":"En"]able phasing")
|
||||
src.occupant_message("<font color=\"[phasing?"#00f\">En":"#f00\">Dis"]abled phasing.</font>")
|
||||
return
|
||||
switch_damtype_action.chassis = src
|
||||
switch_damtype_action.Grant(user)
|
||||
|
||||
phasing_action.chassis = src
|
||||
phasing_action.Grant(user)
|
||||
|
||||
|
||||
/obj/mecha/combat/phazon/RemoveActions(var/mob/living/user, var/human_occupant = 0)
|
||||
..()
|
||||
switch_damtype_action.Remove(user)
|
||||
phasing_action.Remove(user)
|
||||
|
||||
|
||||
/datum/action/mecha/mech_switch_damtype
|
||||
name = "Reconfigure arm microtool arrays"
|
||||
button_icon_state = "mech_switch_damtype"
|
||||
|
||||
/datum/action/mecha/mech_switch_damtype/Activate()
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
return
|
||||
var/obj/mecha/combat/phazon/P = chassis
|
||||
var/new_damtype
|
||||
switch(P.damtype)
|
||||
if("tox")
|
||||
new_damtype = "brute"
|
||||
P.occupant_message("Your exosuit's hands form into fists.")
|
||||
if("brute")
|
||||
new_damtype = "fire"
|
||||
P.occupant_message("A torch tip extends from your exosuit's hand, glowing red.")
|
||||
if("fire")
|
||||
new_damtype = "tox"
|
||||
P.occupant_message("A bone-chillingly thick plasteel needle protracts from the exosuit's palm.")
|
||||
P.damtype = new_damtype.
|
||||
playsound(src, 'sound/mecha/mechmove01.ogg', 50, 1)
|
||||
|
||||
|
||||
/datum/action/mecha/mech_toggle_phasing
|
||||
name = "Enable Phasing"
|
||||
button_icon_state = "mech_toggle_phasing"
|
||||
|
||||
/datum/action/mecha/mech_toggle_phasing/Activate()
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
return
|
||||
var/obj/mecha/combat/phazon/P = chassis
|
||||
P.phasing = !P.phasing
|
||||
P.occupant_message("<font color=\"[P.phasing?"#00f\">En":"#f00\">Dis"]abled phasing.</font>")
|
||||
@@ -22,6 +22,6 @@
|
||||
..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/silenced
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/tool/rcd //HAHA IT MAKES WALLS GET IT
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/rcd //HAHA IT MAKES WALLS GET IT
|
||||
ME.attach(src)
|
||||
return
|
||||
@@ -8,23 +8,14 @@
|
||||
icon_state = "mecha_equip"
|
||||
force = 5
|
||||
origin_tech = "materials=2"
|
||||
var/equip_cooldown = 0
|
||||
var/equip_ready = 1
|
||||
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
|
||||
reliability = 1000
|
||||
var/salvageable = 1
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/do_after_cooldown(target=1)
|
||||
sleep(equip_cooldown)
|
||||
set_ready_state(1)
|
||||
if(target && chassis && chassis.occupant)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/New()
|
||||
..()
|
||||
return
|
||||
@@ -42,10 +33,9 @@
|
||||
return 1
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/destroy()//missiles detonating, teleporter creating singularity?
|
||||
/obj/item/mecha_parts/mecha_equipment/Destroy()
|
||||
if(chassis)
|
||||
chassis.equipment -= src
|
||||
listclearnulls(chassis.equipment)
|
||||
if(chassis.selected == src)
|
||||
chassis.selected = null
|
||||
src.update_chassis_page()
|
||||
@@ -55,13 +45,12 @@
|
||||
chassis.occupant << sound('sound/mecha/weapdestr.ogg',volume=50)
|
||||
else
|
||||
chassis.occupant << sound('sound/mecha/critdestr.ogg',volume=50)
|
||||
qdel(src)
|
||||
return
|
||||
chassis = null
|
||||
..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/critfail()
|
||||
if(chassis)
|
||||
log_message("Critical failure",1)
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/get_equip_info()
|
||||
if(!chassis) return
|
||||
@@ -90,13 +79,29 @@
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/action(atom/target)
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/can_attach(obj/mecha/M as obj)
|
||||
if(istype(M))
|
||||
if(M.equipment.len<M.max_equip)
|
||||
return 1
|
||||
return 0
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/start_cooldown()
|
||||
set_ready_state(0)
|
||||
chassis.use_power(energy_drain)
|
||||
sleep(equip_cooldown)
|
||||
set_ready_state(1)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/attach(obj/mecha/M as obj)
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/do_after_cooldown(var/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
|
||||
@@ -121,9 +126,7 @@
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/Topic(href,href_list)
|
||||
if(href_list["detach"])
|
||||
src.detach()
|
||||
return
|
||||
|
||||
detach()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/set_ready_state(state)
|
||||
equip_ready = state
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper
|
||||
|
||||
// Sleeper and Syringe gun
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper
|
||||
name = "mounted sleeper"
|
||||
desc = "Equipment for medical exosuits. A mounted sleeper that stabilizes patients and can inject reagents in the exosuit's reserves."
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
@@ -8,35 +11,33 @@
|
||||
range = MELEE
|
||||
reliability = 1000
|
||||
equip_cooldown = 20
|
||||
var/mob/living/carbon/occupant = null
|
||||
var/datum/global_iterator/pr_mech_sleeper
|
||||
var/mob/living/carbon/patient = null
|
||||
var/inject_amount = 10
|
||||
salvageable = 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/can_attach(obj/mecha/medical/M)
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/can_attach(obj/mecha/medical/M)
|
||||
if(..())
|
||||
if(istype(M))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/New()
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/attach(obj/mecha/M)
|
||||
..()
|
||||
pr_mech_sleeper = new /datum/global_iterator/mech_sleeper(list(src),0)
|
||||
pr_mech_sleeper.set_delay(equip_cooldown)
|
||||
return
|
||||
SSobj.processing |= src
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/allow_drop()
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/allow_drop()
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/destroy()
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/Destroy()
|
||||
SSobj.processing.Remove(src)
|
||||
for(var/atom/movable/AM in src)
|
||||
AM.forceMove(get_turf(src))
|
||||
return ..()
|
||||
..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/Exit(atom/movable/O)
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/Exit(atom/movable/O)
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/action(var/mob/living/carbon/target)
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/action(var/mob/living/carbon/target)
|
||||
if(!action_checks(target))
|
||||
return
|
||||
if(!istype(target))
|
||||
@@ -44,7 +45,7 @@
|
||||
if(target.buckled)
|
||||
occupant_message("<span class='warning'>[target] will not fit into the sleeper because they are buckled to [target.buckled]!</span>")
|
||||
return
|
||||
if(occupant)
|
||||
if(patient)
|
||||
occupant_message("<span class='warning'>The sleeper is already occupied!</span>")
|
||||
return
|
||||
for(var/mob/living/simple_animal/slime/M in range(1,target))
|
||||
@@ -53,81 +54,65 @@
|
||||
return
|
||||
occupant_message("<span class='notice'>You start putting [target] into [src]...</span>")
|
||||
chassis.visible_message("<span class='warning'>[chassis] starts putting [target] into \the [src].</span>")
|
||||
var/C = chassis.loc
|
||||
var/T = target.loc
|
||||
if(do_after_cooldown(target))
|
||||
if(chassis.loc!=C || target.loc!=T)
|
||||
return
|
||||
if(occupant)
|
||||
if(patient)
|
||||
occupant_message("<span class='warning'>The sleeper is already occupied!</span>")
|
||||
return
|
||||
target.forceMove(src)
|
||||
occupant = target
|
||||
patient = target
|
||||
target.reset_view(src)
|
||||
/*
|
||||
if(target.client)
|
||||
target.client.perspective = EYE_PERSPECTIVE
|
||||
target.client.eye = chassis
|
||||
*/
|
||||
set_ready_state(0)
|
||||
pr_mech_sleeper.start()
|
||||
SSobj.processing |= src
|
||||
update_equip_info()
|
||||
occupant_message("<span class='notice'>[target] successfully loaded into [src]. Life support functions engaged.</span>")
|
||||
chassis.visible_message("<span class='warning'>[chassis] loads [target] into [src].</span>")
|
||||
log_message("[target] loaded. Life support functions engaged.")
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/proc/go_out()
|
||||
if(!occupant)
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/proc/go_out()
|
||||
if(!patient)
|
||||
return
|
||||
occupant.forceMove(get_turf(src))
|
||||
occupant_message("[occupant] ejected. Life support functions disabled.")
|
||||
log_message("[occupant] ejected. Life support functions disabled.")
|
||||
occupant.reset_view()
|
||||
/*
|
||||
if(occupant.client)
|
||||
occupant.client.eye = occupant.client.mob
|
||||
occupant.client.perspective = MOB_PERSPECTIVE
|
||||
*/
|
||||
occupant = null
|
||||
pr_mech_sleeper.stop()
|
||||
set_ready_state(1)
|
||||
return
|
||||
patient.forceMove(get_turf(src))
|
||||
occupant_message("[patient] ejected. Life support functions disabled.")
|
||||
log_message("[patient] ejected. Life support functions disabled.")
|
||||
patient.reset_view()
|
||||
SSobj.processing.Remove(src)
|
||||
update_equip_info()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/detach()
|
||||
if(occupant)
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/detach()
|
||||
if(patient)
|
||||
occupant_message("<span class='warning'>Unable to detach [src] - equipment occupied!</span>")
|
||||
return
|
||||
pr_mech_sleeper.stop()
|
||||
SSobj.processing.Remove(src)
|
||||
update_equip_info()
|
||||
return ..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/get_equip_info()
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/get_equip_info()
|
||||
var/output = ..()
|
||||
if(output)
|
||||
var/temp = ""
|
||||
if(occupant)
|
||||
temp = "<br />\[Occupant: [occupant] ([occupant.stat > 1 ? "*DECEASED*" : "Health: [occupant.health]%"])\]<br /><a href='?src=\ref[src];view_stats=1'>View stats</a>|<a href='?src=\ref[src];eject=1'>Eject</a>"
|
||||
if(patient)
|
||||
temp = "<br />\[Occupant: [patient] ([patient.stat > 1 ? "*DECEASED*" : "Health: [patient.health]%"])\]<br /><a href='?src=\ref[src];view_stats=1'>View stats</a>|<a href='?src=\ref[src];eject=1'>Eject</a>"
|
||||
return "[output] [temp]"
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/Topic(href,href_list)
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/Topic(href,href_list)
|
||||
..()
|
||||
var/datum/topic_input/filter = new /datum/topic_input(href,href_list)
|
||||
if(filter.get("eject"))
|
||||
go_out()
|
||||
if(filter.get("view_stats"))
|
||||
chassis.occupant << browse(get_occupant_stats(),"window=msleeper")
|
||||
chassis.occupant << browse(get_patient_stats(),"window=msleeper")
|
||||
onclose(chassis.occupant, "msleeper")
|
||||
return
|
||||
if(filter.get("inject"))
|
||||
inject_reagent(filter.getType("inject",/datum/reagent),filter.getObj("source"))
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/proc/get_occupant_stats()
|
||||
if(!occupant)
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/proc/get_patient_stats()
|
||||
if(!patient)
|
||||
return
|
||||
return {"<html>
|
||||
<head>
|
||||
<title>[occupant] statistics</title>
|
||||
<title>[patient] statistics</title>
|
||||
<script language='javascript' type='text/javascript'>
|
||||
[js_byjax]
|
||||
</script>
|
||||
@@ -139,11 +124,11 @@
|
||||
<body>
|
||||
<h3>Health statistics</h3>
|
||||
<div id="lossinfo">
|
||||
[get_occupant_dam()]
|
||||
[get_patient_dam()]
|
||||
</div>
|
||||
<h3>Reagents in bloodstream</h3>
|
||||
<div id="reagents">
|
||||
[get_occupant_reagents()]
|
||||
[get_patient_reagents()]
|
||||
</div>
|
||||
<div id="injectwith">
|
||||
[get_available_reagents()]
|
||||
@@ -151,9 +136,9 @@
|
||||
</body>
|
||||
</html>"}
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/proc/get_occupant_dam()
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/proc/get_patient_dam()
|
||||
var/t1
|
||||
switch(occupant.stat)
|
||||
switch(patient.stat)
|
||||
if(0)
|
||||
t1 = "Conscious"
|
||||
if(1)
|
||||
@@ -162,26 +147,26 @@
|
||||
t1 = "*dead*"
|
||||
else
|
||||
t1 = "Unknown"
|
||||
return {"<font color="[occupant.health > 50 ? "blue" : "red"]"><b>Health:</b> [occupant.stat > 1 ? "[t1]" : "[occupant.health]% ([t1])"]</font><br />
|
||||
<font color="[occupant.bodytemperature > 50 ? "blue" : "red"]"><b>Core Temperature:</b> [src.occupant.bodytemperature-T0C]°C ([src.occupant.bodytemperature*1.8-459.67]°F)</font><br />
|
||||
<font color="[occupant.getBruteLoss() < 60 ? "blue" : "red"]"><b>Brute Damage:</b> [occupant.getBruteLoss()]%</font><br />
|
||||
<font color="[occupant.getOxyLoss() < 60 ? "blue" : "red"]"><b>Respiratory Damage:</b> [occupant.getOxyLoss()]%</font><br />
|
||||
<font color="[occupant.getToxLoss() < 60 ? "blue" : "red"]"><b>Toxin Content:</b> [occupant.getToxLoss()]%</font><br />
|
||||
<font color="[occupant.getFireLoss() < 60 ? "blue" : "red"]"><b>Burn Severity:</b> [occupant.getFireLoss()]%</font><br />
|
||||
<font color="red">[occupant.getCloneLoss() ? "Subject appears to have cellular damage." : ""]</font><br />
|
||||
<font color="red">[occupant.getBrainLoss() ? "Significant brain damage detected." : ""]</font><br />
|
||||
return {"<font color="[patient.health > 50 ? "blue" : "red"]"><b>Health:</b> [patient.stat > 1 ? "[t1]" : "[patient.health]% ([t1])"]</font><br />
|
||||
<font color="[patient.bodytemperature > 50 ? "blue" : "red"]"><b>Core Temperature:</b> [patient.bodytemperature-T0C]°C ([patient.bodytemperature*1.8-459.67]°F)</font><br />
|
||||
<font color="[patient.getBruteLoss() < 60 ? "blue" : "red"]"><b>Brute Damage:</b> [patient.getBruteLoss()]%</font><br />
|
||||
<font color="[patient.getOxyLoss() < 60 ? "blue" : "red"]"><b>Respiratory Damage:</b> [patient.getOxyLoss()]%</font><br />
|
||||
<font color="[patient.getToxLoss() < 60 ? "blue" : "red"]"><b>Toxin Content:</b> [patient.getToxLoss()]%</font><br />
|
||||
<font color="[patient.getFireLoss() < 60 ? "blue" : "red"]"><b>Burn Severity:</b> [patient.getFireLoss()]%</font><br />
|
||||
<font color="red">[patient.getCloneLoss() ? "Subject appears to have cellular damage." : ""]</font><br />
|
||||
<font color="red">[patient.getBrainLoss() ? "Significant brain damage detected." : ""]</font><br />
|
||||
"}
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/proc/get_occupant_reagents()
|
||||
if(occupant.reagents)
|
||||
for(var/datum/reagent/R in occupant.reagents.reagent_list)
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/proc/get_patient_reagents()
|
||||
if(patient.reagents)
|
||||
for(var/datum/reagent/R in patient.reagents.reagent_list)
|
||||
if(R.volume > 0)
|
||||
. += "[R]: [round(R.volume,0.01)]<br />"
|
||||
return . || "None"
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/proc/get_available_reagents()
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/proc/get_available_reagents()
|
||||
var/output
|
||||
var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/SG = locate(/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun) in chassis
|
||||
var/obj/item/mecha_parts/mecha_equipment/syringe_gun/SG = locate(/obj/item/mecha_parts/mecha_equipment/syringe_gun) in chassis
|
||||
if(SG && SG.reagents && islist(SG.reagents.reagent_list))
|
||||
for(var/datum/reagent/R in SG.reagents.reagent_list)
|
||||
if(R.volume > 0)
|
||||
@@ -189,41 +174,41 @@
|
||||
return output
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/proc/inject_reagent(var/datum/reagent/R,var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/SG)
|
||||
if(!R || !occupant || !SG || !(SG in chassis.equipment))
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/proc/inject_reagent(var/datum/reagent/R,var/obj/item/mecha_parts/mecha_equipment/syringe_gun/SG)
|
||||
if(!R || !patient || !SG || !(SG in chassis.equipment))
|
||||
return 0
|
||||
var/to_inject = min(R.volume, inject_amount)
|
||||
if(to_inject && occupant.reagents.get_reagent_amount(R.id) + to_inject <= inject_amount*2)
|
||||
occupant_message("Injecting [occupant] with [to_inject] units of [R.name].")
|
||||
log_message("Injecting [occupant] with [to_inject] units of [R.name].")
|
||||
add_logs(chassis.occupant, occupant, "injected", object="[name] ([R] - [to_inject] units)")
|
||||
SG.reagents.trans_id_to(occupant,R.id,to_inject)
|
||||
if(to_inject && patient.reagents.get_reagent_amount(R.id) + to_inject <= inject_amount*2)
|
||||
occupant_message("Injecting [patient] with [to_inject] units of [R.name].")
|
||||
log_message("Injecting [patient] with [to_inject] units of [R.name].")
|
||||
add_logs(chassis.occupant, patient, "injected", object="[name] ([R] - [to_inject] units)")
|
||||
SG.reagents.trans_id_to(patient,R.id,to_inject)
|
||||
update_equip_info()
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/update_equip_info()
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/update_equip_info()
|
||||
if(..())
|
||||
send_byjax(chassis.occupant,"msleeper.browser","lossinfo",get_occupant_dam())
|
||||
send_byjax(chassis.occupant,"msleeper.browser","reagents",get_occupant_reagents())
|
||||
send_byjax(chassis.occupant,"msleeper.browser","lossinfo",get_patient_dam())
|
||||
send_byjax(chassis.occupant,"msleeper.browser","reagents",get_patient_reagents())
|
||||
send_byjax(chassis.occupant,"msleeper.browser","injectwith",get_available_reagents())
|
||||
return 1
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/container_resist()
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/container_resist()
|
||||
go_out()
|
||||
|
||||
/datum/global_iterator/mech_sleeper
|
||||
|
||||
/datum/global_iterator/mech_sleeper/process(var/obj/item/mecha_parts/mecha_equipment/tool/sleeper/S)
|
||||
if(!S.chassis)
|
||||
S.set_ready_state(1)
|
||||
return stop()
|
||||
if(!S.chassis.has_charge(S.energy_drain))
|
||||
S.set_ready_state(1)
|
||||
S.log_message("Deactivated.")
|
||||
S.occupant_message("[src] deactivated - no power.")
|
||||
return stop()
|
||||
var/mob/living/carbon/M = S.occupant
|
||||
/obj/item/mecha_parts/mecha_equipment/sleeper/process()
|
||||
if(!chassis)
|
||||
SSobj.processing.Remove(src)
|
||||
return
|
||||
if(!chassis.has_charge(energy_drain))
|
||||
set_ready_state(1)
|
||||
log_message("Deactivated.")
|
||||
occupant_message("[src] deactivated - no power.")
|
||||
SSobj.processing.Remove(src)
|
||||
return
|
||||
var/mob/living/carbon/M = patient
|
||||
if(!M)
|
||||
return
|
||||
if(M.health > 0)
|
||||
@@ -234,11 +219,16 @@
|
||||
M.AdjustStunned(-4)
|
||||
if(M.reagents.get_reagent_amount("epinephrine") < 5)
|
||||
M.reagents.add_reagent("epinephrine", 5)
|
||||
S.chassis.use_power(S.energy_drain)
|
||||
S.update_equip_info()
|
||||
return
|
||||
chassis.use_power(energy_drain)
|
||||
update_equip_info()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun
|
||||
|
||||
|
||||
|
||||
///////////////////////////////// Syringe Gun ///////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun
|
||||
name = "exosuit syringe gun"
|
||||
desc = "Equipment for medical exosuits. A chem synthesizer with syringe gun. Reagents inside are held in stasis, so no reactions will occur."
|
||||
icon = 'icons/obj/guns/projectile.dmi'
|
||||
@@ -251,42 +241,44 @@
|
||||
var/synth_speed = 5 //[num] reagent units per cycle
|
||||
energy_drain = 10
|
||||
var/mode = 0 //0 - fire syringe, 1 - analyze reagents.
|
||||
var/datum/global_iterator/mech_synth/synth
|
||||
range = MELEE|RANGED
|
||||
equip_cooldown = 10
|
||||
origin_tech = "materials=3;biotech=4;magnets=4;programming=3"
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/New()
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/New()
|
||||
..()
|
||||
flags |= NOREACT
|
||||
syringes = new
|
||||
known_reagents = list("epinephrine"="Epinephrine","charcoal"="Charcoal")
|
||||
processed_reagents = new
|
||||
create_reagents(max_volume)
|
||||
synth = new (list(src),0)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/detach()
|
||||
synth.stop()
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/detach()
|
||||
SSobj.processing.Remove(src)
|
||||
return ..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/critfail()
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/Destroy()
|
||||
SSobj.processing.Remove(src)
|
||||
..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/critfail()
|
||||
..()
|
||||
flags &= ~NOREACT
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/can_attach(obj/mecha/medical/M)
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/can_attach(obj/mecha/medical/M)
|
||||
if(..())
|
||||
if(istype(M))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/get_equip_info()
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/get_equip_info()
|
||||
var/output = ..()
|
||||
if(output)
|
||||
return "[output] \[<a href=\"?src=\ref[src];toggle_mode=1\">[mode? "Analyze" : "Launch"]</a>\]<br />\[Syringes: [syringes.len]/[max_syringes] | Reagents: [reagents.total_volume]/[reagents.maximum_volume]\]<br /><a href='?src=\ref[src];show_reagents=1'>Reagents list</a>"
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/action(atom/movable/target)
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/action(atom/movable/target)
|
||||
if(!action_checks(target))
|
||||
return
|
||||
if(istype(target,/obj/item/weapon/reagent_containers/syringe))
|
||||
@@ -303,8 +295,6 @@
|
||||
if(reagents.total_volume<=0)
|
||||
occupant_message("<span class=\"alert\">No available reagents to load syringe with.</span>")
|
||||
return
|
||||
set_ready_state(0)
|
||||
chassis.use_power(energy_drain)
|
||||
var/turf/trg = get_turf(target)
|
||||
var/obj/item/weapon/reagent_containers/syringe/mechsyringe = syringes[1]
|
||||
mechsyringe.forceMove(get_turf(chassis))
|
||||
@@ -315,7 +305,7 @@
|
||||
playsound(chassis, 'sound/items/syringeproj.ogg', 50, 1)
|
||||
log_message("Launched [mechsyringe] from [src], targeting [target].")
|
||||
var/mob/originaloccupant = chassis.occupant
|
||||
spawn(-1)
|
||||
spawn(0)
|
||||
src = null //if src is deleted, still process the syringe
|
||||
for(var/i=0, i<6, i++)
|
||||
if(!mechsyringe)
|
||||
@@ -350,11 +340,10 @@
|
||||
mechsyringe.update_icon()
|
||||
break
|
||||
sleep(1)
|
||||
do_after_cooldown()
|
||||
return 1
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/Topic(href,href_list)
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/Topic(href,href_list)
|
||||
..()
|
||||
var/datum/topic_input/filter = new (href,href_list)
|
||||
if(filter.get("toggle_mode"))
|
||||
@@ -375,7 +364,7 @@
|
||||
m++
|
||||
if(processed_reagents.len)
|
||||
message += " added to production"
|
||||
synth.start()
|
||||
SSobj.processing |= src
|
||||
occupant_message(message)
|
||||
occupant_message("Reagent processing started.")
|
||||
log_message("Reagent processing started.")
|
||||
@@ -392,7 +381,7 @@
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/proc/get_reagents_page()
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/proc/get_reagents_page()
|
||||
var/output = {"<html>
|
||||
<head>
|
||||
<title>Reagent Synthesizer</title>
|
||||
@@ -420,7 +409,7 @@
|
||||
"}
|
||||
return output
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/proc/get_reagents_form()
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/proc/get_reagents_form()
|
||||
var/r_list = get_reagents_list()
|
||||
var/inputs
|
||||
if(r_list)
|
||||
@@ -435,14 +424,14 @@
|
||||
"}
|
||||
return output
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/proc/get_reagents_list()
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/proc/get_reagents_list()
|
||||
var/output
|
||||
for(var/i=1 to known_reagents.len)
|
||||
var/reagent_id = known_reagents[i]
|
||||
output += {"<input type="checkbox" value="[reagent_id]" name="reagent_[i]" [(reagent_id in processed_reagents)? "checked=\"1\"" : null]> [known_reagents[reagent_id]]<br />"}
|
||||
return output
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/proc/get_current_reagents()
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/proc/get_current_reagents()
|
||||
var/output
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
if(R.volume > 0)
|
||||
@@ -451,7 +440,7 @@
|
||||
output += "Total: [round(reagents.total_volume,0.001)]/[reagents.maximum_volume] - <a href=\"?src=\ref[src];purge_all=1\">Purge All</a>"
|
||||
return output || "None"
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/proc/load_syringe(obj/item/weapon/reagent_containers/syringe/S)
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/proc/load_syringe(obj/item/weapon/reagent_containers/syringe/S)
|
||||
if(syringes.len<max_syringes)
|
||||
if(get_dist(src,S) >= 2)
|
||||
occupant_message("The syringe is too far away.")
|
||||
@@ -473,7 +462,7 @@
|
||||
occupant_message("The [src] syringe chamber is full.")
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/proc/analyze_reagents(atom/A)
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/proc/analyze_reagents(atom/A)
|
||||
if(get_dist(src,A) >= 4)
|
||||
occupant_message("The object is too far away.")
|
||||
return 0
|
||||
@@ -488,42 +477,38 @@
|
||||
occupant_message("Analyzis complete.")
|
||||
return 1
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/proc/add_known_reagent(r_id,r_name)
|
||||
set_ready_state(0)
|
||||
do_after_cooldown()
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/proc/add_known_reagent(r_id,r_name)
|
||||
if(!(r_id in known_reagents))
|
||||
known_reagents += r_id
|
||||
known_reagents[r_id] = r_name
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/update_equip_info()
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/update_equip_info()
|
||||
if(..())
|
||||
send_byjax(chassis.occupant,"msyringegun.browser","reagents",get_current_reagents())
|
||||
send_byjax(chassis.occupant,"msyringegun.browser","reagents_form",get_reagents_form())
|
||||
return 1
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/on_reagent_change()
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/on_reagent_change()
|
||||
..()
|
||||
update_equip_info()
|
||||
return
|
||||
|
||||
/datum/global_iterator/mech_synth
|
||||
delay = 100
|
||||
|
||||
/datum/global_iterator/mech_synth/process(var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/S)
|
||||
if(!S.chassis)
|
||||
return stop()
|
||||
var/energy_drain = S.energy_drain*10
|
||||
if(!S.processed_reagents.len || S.reagents.total_volume >= S.reagents.maximum_volume || !S.chassis.has_charge(energy_drain))
|
||||
S.occupant_message("<span class=\"alert\">Reagent processing stopped.</a>")
|
||||
S.log_message("Reagent processing stopped.")
|
||||
return stop()
|
||||
if(anyprob(S.reliability))
|
||||
S.critfail()
|
||||
var/amount = S.synth_speed / S.processed_reagents.len
|
||||
for(var/reagent in S.processed_reagents)
|
||||
S.reagents.add_reagent(reagent,amount)
|
||||
S.chassis.use_power(energy_drain)
|
||||
return 1
|
||||
/obj/item/mecha_parts/mecha_equipment/syringe_gun/process()
|
||||
if(!chassis)
|
||||
SSobj.processing.Remove(src)
|
||||
return
|
||||
if(!processed_reagents.len || reagents.total_volume >= reagents.maximum_volume || !chassis.has_charge(energy_drain))
|
||||
occupant_message("<span class=\"alert\">Reagent processing stopped.</a>")
|
||||
log_message("Reagent processing stopped.")
|
||||
SSobj.processing.Remove(src)
|
||||
if(anyprob(reliability))
|
||||
critfail()
|
||||
var/amount = synth_speed / processed_reagents.len
|
||||
for(var/reagent in processed_reagents)
|
||||
reagents.add_reagent(reagent,amount)
|
||||
chassis.use_power(energy_drain)
|
||||
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
|
||||
// Drill, Diamond drill, Mining scanner
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/drill
|
||||
name = "exosuit drill"
|
||||
desc = "Equipment for engineering and combat exosuits. This is the drill that'll pierce the heavens!"
|
||||
icon_state = "mecha_drill"
|
||||
equip_cooldown = 30
|
||||
energy_drain = 10
|
||||
force = 15
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/drill/action(atom/target)
|
||||
if(!action_checks(target))
|
||||
return
|
||||
if(istype(target, /turf) && !istype(target, /turf/simulated))
|
||||
return
|
||||
if(isobj(target))
|
||||
var/obj/target_obj = target
|
||||
if(target_obj.unacidable)
|
||||
return
|
||||
target.visible_message("<span class='warning'>[chassis] starts to drill [target].</span>", \
|
||||
"<span class='userdanger'>[chassis] starts to drill [target]...</span>", \
|
||||
"<span class='italics'>You hear drilling.</span>")
|
||||
|
||||
if(do_after_cooldown(target))
|
||||
if(istype(target, /turf/simulated/wall/r_wall))
|
||||
if(istype(src , /obj/item/mecha_parts/mecha_equipment/drill/diamonddrill))
|
||||
if(do_after_cooldown(target))//To slow down how fast mechs can drill through the station
|
||||
log_message("Drilled through [target]")
|
||||
target.ex_act(3)
|
||||
else
|
||||
occupant_message("<span class='danger'>[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)
|
||||
M.gets_drilled(chassis.occupant)
|
||||
log_message("Drilled through [target]")
|
||||
if(locate(/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp) in chassis.equipment)
|
||||
var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo
|
||||
if(ore_box)
|
||||
for(var/obj/item/weapon/ore/ore in range(chassis,1))
|
||||
if(get_dir(chassis,ore)&chassis.dir)
|
||||
ore.Move(ore_box)
|
||||
else if(istype(target, /turf/simulated/floor/plating/asteroid))
|
||||
for(var/turf/simulated/floor/plating/asteroid/M in range(chassis,1))
|
||||
if(get_dir(chassis,M)&chassis.dir)
|
||||
M.gets_dug()
|
||||
log_message("Drilled through [target]")
|
||||
if(locate(/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp) in chassis.equipment)
|
||||
var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo
|
||||
if(ore_box)
|
||||
for(var/obj/item/weapon/ore/ore in range(chassis,1))
|
||||
if(get_dir(chassis,ore)&chassis.dir)
|
||||
ore.Move(ore_box)
|
||||
else
|
||||
log_message("Drilled through [target]")
|
||||
if(isliving(target))
|
||||
if(istype(src , /obj/item/mecha_parts/mecha_equipment/drill/diamonddrill))
|
||||
drill_mob(target, chassis.occupant, 120)
|
||||
else
|
||||
drill_mob(target, chassis.occupant)
|
||||
else
|
||||
target.ex_act(2)
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/drill/can_attach(obj/mecha/M as obj)
|
||||
if(..())
|
||||
if(istype(M, /obj/mecha/working) || istype(M, /obj/mecha/combat))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/drill/proc/drill_mob(mob/living/target, mob/user, var/drill_damage=80)
|
||||
target.visible_message("<span class='danger'>[chassis] drills [target] with [src].</span>", \
|
||||
"<span class='userdanger'>[chassis] drills [target] with [src].</span>")
|
||||
add_logs(user, target, "attacked", object="[name]", addition="(INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])")
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
var/obj/item/organ/limb/affecting = H.get_organ("chest")
|
||||
affecting.take_damage(drill_damage)
|
||||
H.update_damage_overlays(0)
|
||||
else
|
||||
target.take_organ_damage(drill_damage)
|
||||
if(target)
|
||||
target.Paralyse(10)
|
||||
target.updatehealth()
|
||||
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/drill/diamonddrill
|
||||
name = "diamond-tipped exosuit drill"
|
||||
desc = "Equipment for engineering and combat exosuits. This is an upgraded version of the drill that'll pierce the heavens!"
|
||||
icon_state = "mecha_diamond_drill"
|
||||
origin_tech = "materials=4;engineering=3"
|
||||
equip_cooldown = 20
|
||||
force = 15
|
||||
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/mining_scanner
|
||||
name = "exosuit mining scanner"
|
||||
desc = "Equipment for engineering and combat exosuits. It will automatically check surrounding rock for useful minerals."
|
||||
icon_state = "mecha_analyzer"
|
||||
origin_tech = "materials=3;engineering=2"
|
||||
equip_cooldown = 30
|
||||
var/scanning = 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/mining_scanner/New()
|
||||
SSobj.processing |= src
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/mining_scanner/process()
|
||||
if(!loc)
|
||||
SSobj.processing.Remove(src)
|
||||
qdel(src)
|
||||
if(scanning)
|
||||
return
|
||||
if(istype(loc,/obj/mecha/working))
|
||||
var/obj/mecha/working/mecha = loc
|
||||
if(!mecha.occupant)
|
||||
return
|
||||
var/list/occupant = list()
|
||||
occupant |= mecha.occupant
|
||||
scanning = 1
|
||||
mineral_scan_pulse(occupant,get_turf(loc))
|
||||
spawn(equip_cooldown)
|
||||
scanning = 0
|
||||
|
||||
@@ -0,0 +1,518 @@
|
||||
|
||||
// Teleporter, Wormhole generator, Gravitational catapult, Armor booster modules,
|
||||
// Repair droid, Tesla Energy relay, Generators
|
||||
|
||||
////////////////////////////////////////////// TELEPORTER ///////////////////////////////////////////////
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/teleporter
|
||||
name = "mounted teleporter"
|
||||
desc = "An exosuit module that allows exosuits to teleport to any position in view."
|
||||
icon_state = "mecha_teleport"
|
||||
origin_tech = "bluespace=10"
|
||||
equip_cooldown = 150
|
||||
energy_drain = 1000
|
||||
range = RANGED
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/teleporter/action(atom/target)
|
||||
if(!action_checks(target) || src.loc.z == ZLEVEL_CENTCOM) return
|
||||
var/turf/T = get_turf(target)
|
||||
if(T)
|
||||
do_teleport(chassis, T, 4)
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////// WORMHOLE GENERATOR //////////////////////////////////////////
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/wormhole_generator
|
||||
name = "mounted wormhole generator"
|
||||
desc = "An exosuit module that allows generating of small quasi-stable wormholes."
|
||||
icon_state = "mecha_wholegen"
|
||||
origin_tech = "bluespace=3"
|
||||
equip_cooldown = 50
|
||||
energy_drain = 300
|
||||
range = RANGED
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/wormhole_generator/action(atom/target)
|
||||
if(!action_checks(target) || src.loc.z == ZLEVEL_CENTCOM) return
|
||||
var/list/theareas = list()
|
||||
for(var/area/AR in orange(100, chassis))
|
||||
if(AR in theareas) continue
|
||||
theareas += AR
|
||||
if(!theareas.len)
|
||||
return
|
||||
var/area/thearea = pick(theareas)
|
||||
var/list/L = list()
|
||||
var/turf/pos = get_turf(src)
|
||||
for(var/turf/T in get_area_turfs(thearea.type))
|
||||
if(!T.density && pos.z == T.z)
|
||||
var/clear = 1
|
||||
for(var/obj/O in T)
|
||||
if(O.density)
|
||||
clear = 0
|
||||
break
|
||||
if(clear)
|
||||
L+=T
|
||||
if(!L.len)
|
||||
return
|
||||
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"
|
||||
var/turf/T = get_turf(target)
|
||||
message_admins("[key_name_admin(chassis.occupant, chassis.occupant.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[chassis.occupant]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[chassis.occupant]'>FLW</A>) used a Wormhole Generator in ([T.x],[T.y],[T.z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[T.x];Y=[T.y];Z=[T.z]'>JMP</a>)",0,1)
|
||||
log_game("[key_name(chassis.occupant)] used a Wormhole Generator in ([T.x],[T.y],[T.z])")
|
||||
src = null
|
||||
spawn(rand(150,300))
|
||||
qdel(P)
|
||||
return 1
|
||||
|
||||
|
||||
/////////////////////////////////////// GRAVITATIONAL CATAPULT ///////////////////////////////////////////
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/gravcatapult
|
||||
name = "mounted gravitational catapult"
|
||||
desc = "An exosuit mounted Gravitational Catapult."
|
||||
icon_state = "mecha_teleport"
|
||||
origin_tech = "bluespace=2;magnets=3"
|
||||
equip_cooldown = 10
|
||||
energy_drain = 100
|
||||
range = MELEE|RANGED
|
||||
var/atom/movable/locked
|
||||
var/mode = 1 //1 - gravsling 2 - gravpush
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/gravcatapult/action(atom/movable/target)
|
||||
if(!action_checks(target))
|
||||
return
|
||||
switch(mode)
|
||||
if(1)
|
||||
if(!locked)
|
||||
if(!istype(target) || target.anchored)
|
||||
occupant_message("Unable to lock on [target]")
|
||||
return
|
||||
locked = target
|
||||
occupant_message("Locked on [target]")
|
||||
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
|
||||
else if(target!=locked)
|
||||
if(locked in view(chassis))
|
||||
locked.throw_at(target, 14, 1.5)
|
||||
locked = null
|
||||
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
|
||||
return 1
|
||||
else
|
||||
locked = null
|
||||
occupant_message("Lock on [locked] disengaged.")
|
||||
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
|
||||
if(2)
|
||||
var/list/atoms = list()
|
||||
if(isturf(target))
|
||||
atoms = range(target,3)
|
||||
else
|
||||
atoms = orange(target,3)
|
||||
for(var/atom/movable/A in atoms)
|
||||
if(A.anchored) continue
|
||||
spawn(0)
|
||||
var/iter = 5-get_dist(A,target)
|
||||
for(var/i=0 to iter)
|
||||
step_away(A,target)
|
||||
sleep(2)
|
||||
var/turf/T = get_turf(target)
|
||||
log_game("[chassis.occupant.ckey]([chassis.occupant]) used a Gravitational Catapult in ([T.x],[T.y],[T.z])")
|
||||
return 1
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/gravcatapult/get_equip_info()
|
||||
return "[..()] [mode==1?"([locked||"Nothing"])":null] \[<a href='?src=\ref[src];mode=1'>S</a>|<a href='?src=\ref[src];mode=2'>P</a>\]"
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/gravcatapult/Topic(href, href_list)
|
||||
..()
|
||||
if(href_list["mode"])
|
||||
mode = text2num(href_list["mode"])
|
||||
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
//////////////////////////// ARMOR BOOSTER MODULES //////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/anticcw_armor_booster //what is that noise? A BAWWW from TK mutants.
|
||||
name = "armor booster module (Close Combat Weaponry)"
|
||||
desc = "Boosts exosuit armor against armed melee attacks. Requires energy to operate."
|
||||
icon_state = "mecha_abooster_ccw"
|
||||
origin_tech = "materials=3"
|
||||
equip_cooldown = 10
|
||||
energy_drain = 50
|
||||
range = 0
|
||||
var/deflect_coeff = 1.15
|
||||
var/damage_coeff = 0.8
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/anticcw_armor_booster/can_attach(obj/mecha/combat/M as obj)
|
||||
if(..())
|
||||
if(istype(M))
|
||||
return 1
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/anticcw_armor_booster/get_equip_info()
|
||||
if(!chassis) return
|
||||
return "<span style=\"color:[equip_ready?"#0f0":"#f00"];\">*</span> [src.name]"
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/anticcw_armor_booster/proc/attack_react(mob/user as mob)
|
||||
if(action_checks(user))
|
||||
start_cooldown()
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster
|
||||
name = "armor booster module (Ranged Weaponry)"
|
||||
desc = "Boosts exosuit armor against ranged attacks. Completely blocks taser shots. Requires energy to operate."
|
||||
icon_state = "mecha_abooster_proj"
|
||||
origin_tech = "materials=4"
|
||||
equip_cooldown = 10
|
||||
energy_drain = 50
|
||||
range = 0
|
||||
var/deflect_coeff = 1.15
|
||||
var/damage_coeff = 0.8
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster/can_attach(obj/mecha/combat/M as obj)
|
||||
if(..())
|
||||
if(istype(M))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster/get_equip_info()
|
||||
if(!chassis) return
|
||||
return "<span style=\"color:[equip_ready?"#0f0":"#f00"];\">*</span> [src.name]"
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster/proc/projectile_react()
|
||||
if(action_checks(src))
|
||||
start_cooldown()
|
||||
return 1
|
||||
|
||||
|
||||
////////////////////////////////// REPAIR DROID //////////////////////////////////////////////////
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/repair_droid
|
||||
name = "exosuit repair droid"
|
||||
desc = "An automated repair droid for exosuits. Scans for damage and repairs it. Can fix almost all types of external or internal damage."
|
||||
icon_state = "repair_droid"
|
||||
origin_tech = "magnets=3;programming=3"
|
||||
energy_drain = 50
|
||||
range = 0
|
||||
var/health_boost = 1
|
||||
var/icon/droid_overlay
|
||||
var/list/repairable_damage = list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/repair_droid/Destroy()
|
||||
SSobj.processing.Remove(src)
|
||||
if(chassis)
|
||||
chassis.overlays -= droid_overlay
|
||||
..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/repair_droid/attach(obj/mecha/M as obj)
|
||||
..()
|
||||
droid_overlay = new(src.icon, icon_state = "repair_droid")
|
||||
M.overlays += droid_overlay
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/repair_droid/detach()
|
||||
chassis.overlays -= droid_overlay
|
||||
SSobj.processing.Remove(src)
|
||||
..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/repair_droid/get_equip_info()
|
||||
if(!chassis) return
|
||||
return "<span style=\"color:[equip_ready?"#0f0":"#f00"];\">*</span> [src.name] - <a href='?src=\ref[src];toggle_repairs=1'>[equip_ready?"A":"Dea"]ctivate</a>"
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/repair_droid/Topic(href, href_list)
|
||||
..()
|
||||
if(href_list["toggle_repairs"])
|
||||
chassis.overlays -= droid_overlay
|
||||
if(equip_ready)
|
||||
SSobj.processing |= src
|
||||
droid_overlay = new(src.icon, icon_state = "repair_droid_a")
|
||||
log_message("Activated.")
|
||||
set_ready_state(0)
|
||||
else
|
||||
SSobj.processing.Remove(src)
|
||||
droid_overlay = new(src.icon, icon_state = "repair_droid")
|
||||
log_message("Deactivated.")
|
||||
set_ready_state(1)
|
||||
chassis.overlays += droid_overlay
|
||||
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/repair_droid/process()
|
||||
if(!chassis)
|
||||
SSobj.processing.Remove(src)
|
||||
set_ready_state(1)
|
||||
return
|
||||
var/h_boost = health_boost
|
||||
var/repaired = 0
|
||||
if(chassis.internal_damage & MECHA_INT_SHORT_CIRCUIT)
|
||||
h_boost *= -2
|
||||
else if(chassis.internal_damage && prob(15))
|
||||
for(var/int_dam_flag in repairable_damage)
|
||||
if(chassis.internal_damage & int_dam_flag)
|
||||
chassis.clearInternalDamage(int_dam_flag)
|
||||
repaired = 1
|
||||
break
|
||||
if(health_boost<0 || chassis.health < initial(chassis.health))
|
||||
chassis.health += min(health_boost, initial(chassis.health)-chassis.health)
|
||||
repaired = 1
|
||||
if(repaired)
|
||||
if(!chassis.use_power(energy_drain))
|
||||
SSobj.processing.Remove(src)
|
||||
set_ready_state(1)
|
||||
else //no repair needed, we turn off
|
||||
SSobj.processing.Remove(src)
|
||||
set_ready_state(1)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////// TESLA ENERGY RELAY ////////////////////////////////////////////////
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay
|
||||
name = "exosuit energy relay"
|
||||
desc = "An exosuit module that wirelessly drains energy from any available power channel in area. The performance index is quite low."
|
||||
icon_state = "tesla"
|
||||
origin_tech = "magnets=4;powerstorage=3"
|
||||
energy_drain = 0
|
||||
range = 0
|
||||
var/coeff = 100
|
||||
var/list/use_channels = list(EQUIP,ENVIRON,LIGHT)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/Destroy()
|
||||
SSobj.processing.Remove(src)
|
||||
..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/detach()
|
||||
SSobj.processing.Remove(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/proc/get_charge()
|
||||
if(equip_ready) //disabled
|
||||
return
|
||||
var/area/A = get_area(chassis)
|
||||
var/pow_chan = get_power_channel(A)
|
||||
if(pow_chan)
|
||||
return 1000 //making magic
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/proc/get_power_channel(var/area/A)
|
||||
var/pow_chan
|
||||
if(A)
|
||||
for(var/c in use_channels)
|
||||
if(A.master && A.master.powered(c))
|
||||
pow_chan = c
|
||||
break
|
||||
return pow_chan
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/Topic(href, href_list)
|
||||
..()
|
||||
if(href_list["toggle_relay"])
|
||||
if(equip_ready) //inactive
|
||||
SSobj.processing |= src
|
||||
set_ready_state(0)
|
||||
log_message("Activated.")
|
||||
else
|
||||
SSobj.processing.Remove(src)
|
||||
set_ready_state(1)
|
||||
log_message("Deactivated.")
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/get_equip_info()
|
||||
if(!chassis) return
|
||||
return "<span style=\"color:[equip_ready?"#0f0":"#f00"];\">*</span> [src.name] - <a href='?src=\ref[src];toggle_relay=1'>[equip_ready?"A":"Dea"]ctivate</a>"
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/process()
|
||||
if(!chassis || chassis.internal_damage & MECHA_INT_SHORT_CIRCUIT)
|
||||
SSobj.processing.Remove(src)
|
||||
set_ready_state(1)
|
||||
return
|
||||
var/cur_charge = chassis.get_charge()
|
||||
if(isnull(cur_charge) || !chassis.cell)
|
||||
SSobj.processing.Remove(src)
|
||||
set_ready_state(1)
|
||||
occupant_message("No powercell detected.")
|
||||
return
|
||||
if(cur_charge < chassis.cell.maxcharge)
|
||||
var/area/A = get_area(chassis)
|
||||
if(A)
|
||||
var/pow_chan
|
||||
for(var/c in list(EQUIP,ENVIRON,LIGHT))
|
||||
if(A.master.powered(c))
|
||||
pow_chan = c
|
||||
break
|
||||
if(pow_chan)
|
||||
var/delta = min(15, chassis.cell.maxcharge-cur_charge)
|
||||
chassis.give_power(delta)
|
||||
A.master.use_power(delta*coeff, pow_chan)
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////// GENERATOR /////////////////////////////////////////////
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator
|
||||
name = "exosuit plasma converter"
|
||||
desc = "An exosuit module that generates power using solid plasma as fuel. Pollutes the environment."
|
||||
icon_state = "tesla"
|
||||
origin_tech = "plasmatech=2;powerstorage=2;engineering=1"
|
||||
range = MELEE
|
||||
var/coeff = 100
|
||||
var/obj/item/stack/sheet/fuel
|
||||
var/max_fuel = 150000
|
||||
var/fuel_per_cycle_idle = 25
|
||||
var/fuel_per_cycle_active = 200
|
||||
var/power_per_cycle = 20
|
||||
reliability = 1000
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator/New()
|
||||
..()
|
||||
generator_init()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator/Destroy()
|
||||
SSobj.processing.Remove(src)
|
||||
..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator/proc/generator_init()
|
||||
fuel = new /obj/item/stack/sheet/mineral/plasma(src)
|
||||
fuel.amount = 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator/detach()
|
||||
SSobj.processing.Remove(src)
|
||||
..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator/Topic(href, href_list)
|
||||
..()
|
||||
if(href_list["toggle"])
|
||||
if(equip_ready) //inactive
|
||||
set_ready_state(0)
|
||||
SSobj.processing |= src
|
||||
log_message("Activated.")
|
||||
else
|
||||
set_ready_state(1)
|
||||
SSobj.processing.Remove(src)
|
||||
log_message("Deactivated.")
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator/get_equip_info()
|
||||
var/output = ..()
|
||||
if(output)
|
||||
return "[output] \[[fuel]: [round(fuel.amount*fuel.perunit,0.1)] cm<sup>3</sup>\] - <a href='?src=\ref[src];toggle=1'>[equip_ready?"A":"Dea"]ctivate</a>"
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator/action(target)
|
||||
if(chassis)
|
||||
var/result = load_fuel(target)
|
||||
if(result)
|
||||
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator/proc/load_fuel(var/obj/item/stack/sheet/P)
|
||||
if(P.type == fuel.type && P.amount > 0)
|
||||
var/to_load = max(max_fuel - fuel.amount*fuel.perunit,0)
|
||||
if(to_load)
|
||||
var/units = min(max(round(to_load / P.perunit),1),P.amount)
|
||||
fuel.amount += units
|
||||
P.use(units)
|
||||
occupant_message("[units] unit\s of [fuel] successfully loaded.")
|
||||
return units
|
||||
else
|
||||
occupant_message("Unit is full.")
|
||||
return 0
|
||||
else
|
||||
occupant_message("<span class='warning'>[fuel] traces in target minimal! [P] cannot be used as fuel.</span>")
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator/attackby(weapon,mob/user, params)
|
||||
load_fuel(weapon)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator/critfail()
|
||||
..()
|
||||
var/turf/simulated/T = get_turf(src)
|
||||
if(!T)
|
||||
return
|
||||
var/datum/gas_mixture/GM = new
|
||||
if(prob(10))
|
||||
GM.toxins += 100
|
||||
GM.temperature = 1500+T0C //should be enough to start a fire
|
||||
T.visible_message("The [src] suddenly disgorges a cloud of heated plasma.")
|
||||
qdel(src)
|
||||
else
|
||||
GM.toxins += 5
|
||||
GM.temperature = istype(T) ? T.air.return_temperature() : T20C
|
||||
T.visible_message("The [src] suddenly disgorges a cloud of plasma.")
|
||||
T.assume_air(GM)
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator/process()
|
||||
if(!chassis)
|
||||
SSobj.processing.Remove(src)
|
||||
set_ready_state(1)
|
||||
return
|
||||
if(fuel.amount<=0)
|
||||
SSobj.processing.Remove(src)
|
||||
log_message("Deactivated - no fuel.")
|
||||
set_ready_state(1)
|
||||
return
|
||||
if(anyprob(reliability))
|
||||
set_ready_state(1) //inactive
|
||||
critfail()
|
||||
SSobj.processing.Remove(src)
|
||||
return
|
||||
var/cur_charge = chassis.get_charge()
|
||||
if(isnull(cur_charge))
|
||||
set_ready_state(1)
|
||||
occupant_message("No powercell detected.")
|
||||
log_message("Deactivated.")
|
||||
SSobj.processing.Remove(src)
|
||||
return
|
||||
var/use_fuel = fuel_per_cycle_idle
|
||||
if(cur_charge < chassis.cell.maxcharge)
|
||||
use_fuel = fuel_per_cycle_active
|
||||
chassis.give_power(power_per_cycle)
|
||||
fuel.amount -= min(use_fuel/fuel.perunit,fuel.amount)
|
||||
update_equip_info()
|
||||
return 1
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator/nuclear
|
||||
name = "exonuclear reactor"
|
||||
desc = "An exosuit module that generates power using uranium as fuel. Pollutes the environment."
|
||||
icon_state = "tesla"
|
||||
origin_tech = "powerstorage=3;engineering=3"
|
||||
max_fuel = 50000
|
||||
fuel_per_cycle_idle = 10
|
||||
fuel_per_cycle_active = 30
|
||||
power_per_cycle = 50
|
||||
var/rad_per_cycle = 0.3
|
||||
reliability = 1000
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator/nuclear/generator_init()
|
||||
fuel = new /obj/item/stack/sheet/mineral/uranium(src)
|
||||
fuel.amount = 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator/nuclear/critfail()
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator/nuclear/process()
|
||||
if(..())
|
||||
for(var/mob/living/carbon/M in view(chassis))
|
||||
if(istype(M,/mob/living/carbon/human))
|
||||
M.irradiate(rad_per_cycle*3)
|
||||
else
|
||||
M.irradiate(rad_per_cycle)
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,424 @@
|
||||
|
||||
//Hydraulic clamp, Kill clamp, Extinguisher, RCD, Cable layer.
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp
|
||||
name = "hydraulic clamp"
|
||||
desc = "Equipment for engineering exosuits. Lifts objects and loads them into cargo."
|
||||
icon_state = "mecha_clamp"
|
||||
equip_cooldown = 15
|
||||
energy_drain = 10
|
||||
var/dam_force = 20
|
||||
var/obj/mecha/working/ripley/cargo_holder
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/can_attach(obj/mecha/working/ripley/M as obj)
|
||||
if(..())
|
||||
if(istype(M))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/attach(obj/mecha/M as obj)
|
||||
..()
|
||||
cargo_holder = M
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/detach(atom/moveto = null)
|
||||
..()
|
||||
cargo_holder = null
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/action(atom/target)
|
||||
if(!action_checks(target))
|
||||
return
|
||||
if(!cargo_holder)
|
||||
return
|
||||
if(istype(target,/obj))
|
||||
var/obj/O = target
|
||||
if(!O.anchored)
|
||||
if(cargo_holder.cargo.len < cargo_holder.cargo_capacity)
|
||||
chassis.visible_message("[chassis] lifts [target] and starts to load it into cargo compartment.")
|
||||
O.anchored = 1
|
||||
if(do_after_cooldown(target))
|
||||
cargo_holder.cargo += O
|
||||
O.loc = chassis
|
||||
O.anchored = 0
|
||||
occupant_message("<span class='notice'>[target] successfully loaded.</span>")
|
||||
log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
|
||||
else
|
||||
O.anchored = initial(O.anchored)
|
||||
else
|
||||
occupant_message("<span class='warning'>Not enough room in cargo compartment!</span>")
|
||||
else
|
||||
occupant_message("<span class='warning'>[target] is firmly secured!</span>")
|
||||
|
||||
else if(istype(target,/mob/living))
|
||||
var/mob/living/M = target
|
||||
if(M.stat == DEAD) return
|
||||
if(chassis.occupant.a_intent == "harm")
|
||||
M.take_overall_damage(dam_force)
|
||||
if(!M)
|
||||
return
|
||||
M.adjustOxyLoss(round(dam_force/2))
|
||||
M.updatehealth()
|
||||
target.visible_message("<span class='danger'>[chassis] squeezes [target].</span>", \
|
||||
"<span class='userdanger'>[chassis] squeezes [target].</span>",\
|
||||
"<span class='italics'>You hear something crack.</span>")
|
||||
add_logs(chassis.occupant, M, "attacked", object="[name]", addition="(INTENT: [uppertext(chassis.occupant.a_intent)]) (DAMTYE: [uppertext(damtype)])")
|
||||
else
|
||||
step_away(M,chassis)
|
||||
occupant_message("You push [target] out of the way.")
|
||||
chassis.visible_message("[chassis] pushes [target] out of the way.")
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
//This is pretty much just for the death-ripley
|
||||
/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/kill
|
||||
name = "\improper KILL CLAMP"
|
||||
desc = "They won't know what clamped them!"
|
||||
energy_drain = 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/kill/action(atom/target)
|
||||
if(!action_checks(target)) return
|
||||
if(!cargo_holder) return
|
||||
if(istype(target,/obj))
|
||||
var/obj/O = target
|
||||
if(!O.anchored)
|
||||
if(cargo_holder.cargo.len < cargo_holder.cargo_capacity)
|
||||
chassis.visible_message("[chassis] lifts [target] and starts to load it into cargo compartment.")
|
||||
O.anchored = 1
|
||||
if(do_after_cooldown(target))
|
||||
cargo_holder.cargo += O
|
||||
O.loc = chassis
|
||||
O.anchored = 0
|
||||
occupant_message("<span class='notice'>[target] successfully loaded.</span>")
|
||||
log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
|
||||
else
|
||||
O.anchored = initial(O.anchored)
|
||||
else
|
||||
occupant_message("<span class='warning'>Not enough room in cargo compartment!</span>")
|
||||
else
|
||||
occupant_message("<span class='warning'>[target] is firmly secured!</span>")
|
||||
|
||||
else if(istype(target,/mob/living))
|
||||
var/mob/living/M = target
|
||||
if(M.stat == DEAD) return
|
||||
if(chassis.occupant.a_intent == "harm")
|
||||
target.visible_message("<span class='danger'>[chassis] destroys [target] in an unholy fury.</span>", \
|
||||
"<span class='userdanger'>[chassis] destroys [target] in an unholy fury.</span>")
|
||||
if(chassis.occupant.a_intent == "disarm")
|
||||
target.visible_message("<span class='danger'>[chassis] rips [target]'s arms off.</span>", \
|
||||
"<span class='userdanger'>[chassis] rips [target]'s arms off.</span>")
|
||||
else
|
||||
step_away(M,chassis)
|
||||
target.visible_message("[chassis] tosses [target] like a piece of paper.")
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/extinguisher
|
||||
name = "exosuit extinguisher"
|
||||
desc = "Equipment for engineering exosuits. A rapid-firing high capacity fire extinguisher."
|
||||
icon_state = "mecha_exting"
|
||||
equip_cooldown = 5
|
||||
energy_drain = 0
|
||||
range = MELEE|RANGED
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/extinguisher/New()
|
||||
create_reagents(1000)
|
||||
reagents.add_reagent("water", 1000)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/extinguisher/action(atom/target) //copypasted from extinguisher. TODO: Rewrite from scratch.
|
||||
if(!action_checks(target) || get_dist(chassis, target)>3)
|
||||
return
|
||||
|
||||
if(istype(target, /obj/structure/reagent_dispensers/watertank) && get_dist(chassis,target) <= 1)
|
||||
var/obj/structure/reagent_dispensers/watertank/WT = target
|
||||
WT.reagents.trans_to(src, 1000)
|
||||
occupant_message("<span class='notice'>Extinguisher refilled.</span>")
|
||||
playsound(chassis, 'sound/effects/refill.ogg', 50, 1, -6)
|
||||
else
|
||||
if(reagents.total_volume > 0)
|
||||
playsound(chassis, 'sound/effects/extinguish.ogg', 75, 1, -3)
|
||||
var/direction = get_dir(chassis,target)
|
||||
var/turf/T = get_turf(target)
|
||||
var/turf/T1 = get_step(T,turn(direction, 90))
|
||||
var/turf/T2 = get_step(T,turn(direction, -90))
|
||||
|
||||
var/list/the_targets = list(T,T1,T2)
|
||||
spawn(0)
|
||||
for(var/a=0, a<5, a++)
|
||||
var/obj/effect/effect/water/W = PoolOrNew(/obj/effect/effect/water, get_turf(chassis))
|
||||
if(!W)
|
||||
return
|
||||
var/turf/my_target = pick(the_targets)
|
||||
var/datum/reagents/R = new/datum/reagents(5)
|
||||
W.reagents = R
|
||||
R.my_atom = W
|
||||
reagents.trans_to(W,1)
|
||||
for(var/b=0, b<4, b++)
|
||||
if(!W)
|
||||
return
|
||||
step_towards(W,my_target)
|
||||
if(!W)
|
||||
return
|
||||
var/turf/W_turf = get_turf(W)
|
||||
W.reagents.reaction(W_turf)
|
||||
for(var/atom/atm in W_turf)
|
||||
W.reagents.reaction(atm)
|
||||
if(W.loc == my_target)
|
||||
break
|
||||
sleep(2)
|
||||
return 1
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/extinguisher/get_equip_info()
|
||||
return "[..()] \[[src.reagents.total_volume]\]"
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/extinguisher/on_reagent_change()
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/extinguisher/can_attach(obj/mecha/working/M as obj)
|
||||
if(..())
|
||||
if(istype(M))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/rcd
|
||||
name = "mounted RCD"
|
||||
desc = "An exosuit-mounted Rapid Construction Device."
|
||||
icon_state = "mecha_rcd"
|
||||
origin_tech = "materials=4;bluespace=3;magnets=4;powerstorage=4"
|
||||
equip_cooldown = 10
|
||||
energy_drain = 250
|
||||
range = MELEE|RANGED
|
||||
var/mode = 0 //0 - deconstruct, 1 - wall or floor, 2 - airlock.
|
||||
var/disabled = 0 //malf
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/rcd/action(atom/target)
|
||||
if(istype(target,/area/shuttle)||istype(target, /turf/space/transit))//>implying these are ever made -Sieve
|
||||
disabled = 1
|
||||
else
|
||||
disabled = 0
|
||||
if(!istype(target, /turf) && !istype(target, /obj/machinery/door/airlock))
|
||||
target = get_turf(target)
|
||||
if(!action_checks(target) || disabled || get_dist(chassis, target)>3)
|
||||
return
|
||||
playsound(chassis, 'sound/machines/click.ogg', 50, 1)
|
||||
|
||||
switch(mode)
|
||||
if(0)
|
||||
if (istype(target, /turf/simulated/wall))
|
||||
var/turf/simulated/wall/W = target
|
||||
occupant_message("Deconstructing [W]...")
|
||||
if(do_after_cooldown(W))
|
||||
chassis.spark_system.start()
|
||||
W.ChangeTurf(/turf/simulated/floor/plating)
|
||||
playsound(W, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
else if (istype(target, /turf/simulated/floor))
|
||||
var/turf/simulated/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)
|
||||
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)
|
||||
if(1)
|
||||
if(istype(target, /turf/space))
|
||||
var/turf/space/S = target
|
||||
occupant_message("Building Floor...")
|
||||
if(do_after_cooldown(S))
|
||||
S.ChangeTurf(/turf/simulated/floor/plating)
|
||||
playsound(S, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
chassis.spark_system.start()
|
||||
else if(istype(target, /turf/simulated/floor))
|
||||
var/turf/simulated/floor/F = target
|
||||
occupant_message("Building Wall...")
|
||||
if(do_after_cooldown(F))
|
||||
if(disabled) return
|
||||
F.ChangeTurf(/turf/simulated/wall)
|
||||
playsound(F, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
chassis.spark_system.start()
|
||||
if(2)
|
||||
if(istype(target, /turf/simulated/floor))
|
||||
occupant_message("Building Airlock...")
|
||||
if(do_after_cooldown(target))
|
||||
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/effects/sparks2.ogg', 50, 1)
|
||||
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/rcd/do_after_cooldown(var/atom/target)
|
||||
. = ..()
|
||||
if(disabled)
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/rcd/Topic(href,href_list)
|
||||
..()
|
||||
if(href_list["mode"])
|
||||
mode = text2num(href_list["mode"])
|
||||
switch(mode)
|
||||
if(0)
|
||||
occupant_message("Switched RCD to Deconstruct.")
|
||||
energy_drain = initial(energy_drain)
|
||||
if(1)
|
||||
occupant_message("Switched RCD to Construct.")
|
||||
energy_drain = 2*initial(energy_drain)
|
||||
if(2)
|
||||
occupant_message("Switched RCD to Construct Airlock.")
|
||||
energy_drain = 2*initial(energy_drain)
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/rcd/get_equip_info()
|
||||
return "[..()] \[<a href='?src=\ref[src];mode=0'>D</a>|<a href='?src=\ref[src];mode=1'>C</a>|<a href='?src=\ref[src];mode=2'>A</a>\]"
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/cable_layer
|
||||
name = "cable layer"
|
||||
desc = "Equipment for engineering exosuits. Lays cable along the exosuit's path."
|
||||
icon_state = "mecha_wire"
|
||||
var/datum/event/event
|
||||
var/turf/old_turf
|
||||
var/obj/structure/cable/last_piece
|
||||
var/obj/item/stack/cable_coil/cable
|
||||
var/max_cable = 1000
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/cable_layer/New()
|
||||
cable = new(src)
|
||||
cable.amount = 0
|
||||
..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/cable_layer/can_attach(obj/mecha/working/M)
|
||||
if(..())
|
||||
if(istype(M))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/cable_layer/attach()
|
||||
..()
|
||||
event = chassis.events.addEvent("onMove",src,"layCable")
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/cable_layer/detach()
|
||||
chassis.events.clearEvent("onMove",event)
|
||||
return ..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/cable_layer/Destroy()
|
||||
chassis.events.clearEvent("onMove",event)
|
||||
..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/cable_layer/action(var/obj/item/stack/cable_coil/target)
|
||||
if(!action_checks(target))
|
||||
return
|
||||
if(istype(target) && target.amount)
|
||||
var/cur_amount = cable? cable.amount : 0
|
||||
var/to_load = max(max_cable - cur_amount,0)
|
||||
if(to_load)
|
||||
to_load = min(target.amount, to_load)
|
||||
if(!cable)
|
||||
cable = new(src)
|
||||
cable.amount = 0
|
||||
cable.amount += to_load
|
||||
target.use(to_load)
|
||||
occupant_message("<span class='notice'>[to_load] meters of cable successfully loaded.</span>")
|
||||
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
|
||||
else
|
||||
occupant_message("<span class='warning'>Reel is full.</span>")
|
||||
else
|
||||
occupant_message("<span class='warning'>Unable to load [target] - no cable found.</span>")
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/cable_layer/Topic(href,href_list)
|
||||
..()
|
||||
if(href_list["toggle"])
|
||||
set_ready_state(!equip_ready)
|
||||
occupant_message("[src] [equip_ready?"dea":"a"]ctivated.")
|
||||
log_message("[equip_ready?"Dea":"A"]ctivated.")
|
||||
return
|
||||
if(href_list["cut"])
|
||||
if(cable && cable.amount)
|
||||
var/m = round(input(chassis.occupant,"Please specify the length of cable to cut","Cut cable",min(cable.amount,30)) as num, 1)
|
||||
m = min(m, cable.amount)
|
||||
if(m)
|
||||
use_cable(m)
|
||||
var/obj/item/stack/cable_coil/CC = new (get_turf(chassis))
|
||||
CC.amount = m
|
||||
else
|
||||
occupant_message("There's no more cable on the reel.")
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/cable_layer/get_equip_info()
|
||||
var/output = ..()
|
||||
if(output)
|
||||
return "[output] \[Cable: [cable ? cable.amount : 0] m\][(cable && cable.amount) ? "- <a href='?src=\ref[src];toggle=1'>[!equip_ready?"Dea":"A"]ctivate</a>|<a href='?src=\ref[src];cut=1'>Cut</a>" : null]"
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/cable_layer/proc/use_cable(amount)
|
||||
if(!cable || cable.amount<1)
|
||||
set_ready_state(1)
|
||||
occupant_message("Cable depleted, [src] deactivated.")
|
||||
log_message("Cable depleted, [src] deactivated.")
|
||||
return
|
||||
if(cable.amount < amount)
|
||||
occupant_message("No enough cable to finish the task.")
|
||||
return
|
||||
cable.use(amount)
|
||||
update_equip_info()
|
||||
return 1
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/cable_layer/proc/reset()
|
||||
last_piece = null
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/cable_layer/proc/dismantleFloor(var/turf/new_turf)
|
||||
if(istype(new_turf, /turf/simulated/floor))
|
||||
var/turf/simulated/floor/T = new_turf
|
||||
if(!istype(T, /turf/simulated/floor/plating))
|
||||
if(!T.broken && !T.burnt)
|
||||
new T.floor_tile(T)
|
||||
T.make_plating()
|
||||
return !new_turf.intact
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/cable_layer/proc/layCable(var/turf/new_turf)
|
||||
if(equip_ready || !istype(new_turf) || !dismantleFloor(new_turf))
|
||||
return reset()
|
||||
var/fdirn = turn(chassis.dir,180)
|
||||
for(var/obj/structure/cable/LC in new_turf) // check to make sure there's not a cable there already
|
||||
if(LC.d1 == fdirn || LC.d2 == fdirn)
|
||||
return reset()
|
||||
if(!use_cable(1))
|
||||
return reset()
|
||||
var/obj/structure/cable/NC = new(new_turf)
|
||||
NC.cableColor("red")
|
||||
NC.d1 = 0
|
||||
NC.d2 = fdirn
|
||||
NC.updateicon()
|
||||
|
||||
var/datum/powernet/PN
|
||||
if(last_piece && last_piece.d2 != chassis.dir)
|
||||
last_piece.d1 = min(last_piece.d2, chassis.dir)
|
||||
last_piece.d2 = max(last_piece.d2, chassis.dir)
|
||||
last_piece.updateicon()
|
||||
PN = last_piece.powernet
|
||||
|
||||
if(!PN)
|
||||
PN = new()
|
||||
powernets += PN
|
||||
NC.powernet = PN
|
||||
PN.cables += NC
|
||||
NC.mergeConnectedNetworks(NC.d2)
|
||||
|
||||
//NC.mergeConnectedNetworksOnTurf()
|
||||
last_piece = NC
|
||||
return 1
|
||||
@@ -20,7 +20,6 @@
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/action(atom/target)
|
||||
if(!action_checks(target))
|
||||
return 0
|
||||
set_ready_state(0)
|
||||
|
||||
var/turf/curloc = get_turf(chassis)
|
||||
var/turf/targloc = get_turf(target)
|
||||
@@ -29,6 +28,10 @@
|
||||
if (targloc == curloc)
|
||||
return 0
|
||||
|
||||
set_ready_state(0)
|
||||
chassis.can_move = 0
|
||||
spawn(shot_delay*projectiles_per_shot)
|
||||
chassis.can_move = 1
|
||||
for(var/i=1 to get_shot_amount())
|
||||
var/obj/item/projectile/A = new projectile(curloc)
|
||||
A.firer = chassis.occupant
|
||||
@@ -49,9 +52,9 @@
|
||||
sleep(shot_delay)
|
||||
|
||||
chassis.log_message("Fired from [src.name], targeting [target].")
|
||||
do_after_cooldown()
|
||||
return 1
|
||||
|
||||
|
||||
//Base energy weapon type
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/energy
|
||||
name = "general energy weapon"
|
||||
@@ -59,10 +62,11 @@
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/energy/get_shot_amount()
|
||||
return min(round(chassis.cell.charge / energy_drain), projectiles_per_shot)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/energy/action(atom/target)
|
||||
..()
|
||||
chassis.use_power(energy_drain * get_shot_amount())
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/energy/start_cooldown()
|
||||
set_ready_state(0)
|
||||
chassis.use_power(energy_drain*get_shot_amount())
|
||||
sleep(equip_cooldown)
|
||||
set_ready_state(1)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/energy/laser
|
||||
equip_cooldown = 8
|
||||
@@ -112,9 +116,9 @@
|
||||
projectile = /obj/item/projectile/plasma/adv/mech
|
||||
fire_sound = 'sound/weapons/Laser.ogg'
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/energy/plasma/can_attach(obj/mecha/M as obj)
|
||||
if(istype(M, /obj/mecha/working))
|
||||
if(M.equipment.len < M.max_equip)
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/energy/plasma/can_attach(obj/mecha/working/M as obj)
|
||||
if(..())
|
||||
if(istype(M))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -158,8 +162,8 @@
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/honker/action(target)
|
||||
if(!action_checks(target)) return 0
|
||||
set_ready_state(0)
|
||||
if(!action_checks(target))
|
||||
return
|
||||
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))
|
||||
@@ -177,24 +181,12 @@
|
||||
M.Paralyse(4)
|
||||
else
|
||||
M.Jitter(500)
|
||||
/* //else the mousetraps are useless
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(isobj(H.shoes))
|
||||
var/thingy = H.shoes
|
||||
H.unEquip(H.shoes)
|
||||
walk_away(thingy,chassis,15,2)
|
||||
spawn(20)
|
||||
if(thingy)
|
||||
walk(thingy,0)
|
||||
*/
|
||||
chassis.use_power(energy_drain)
|
||||
|
||||
log_message("Honked from [src.name]. HONK!")
|
||||
var/turf/T = get_turf(src)
|
||||
message_admins("[key_name_admin(chassis.occupant, chassis.occupant.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[chassis.occupant]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[chassis.occupant]'>FLW</A>) used a Mecha Honker in ([T.x],[T.y],[T.z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[T.x];Y=[T.y];Z=[T.z]'>JMP</a>)",0,1)
|
||||
log_game("[chassis.occupant.ckey]([chassis.occupant]) used a Mecha Honker in ([T.x],[T.y],[T.z])")
|
||||
do_after_cooldown()
|
||||
return
|
||||
return 1
|
||||
|
||||
|
||||
//Base ballistic weapon type
|
||||
@@ -212,8 +204,6 @@
|
||||
return 0
|
||||
if(projectiles <= 0)
|
||||
return 0
|
||||
if(!equip_ready)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/get_equip_info()
|
||||
@@ -238,8 +228,9 @@
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/action(atom/target)
|
||||
if(..())
|
||||
src.projectiles -= get_shot_amount()
|
||||
projectiles -= get_shot_amount()
|
||||
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
|
||||
return 1
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/carbine
|
||||
@@ -284,7 +275,27 @@
|
||||
deviation = 0.3
|
||||
shot_delay = 2
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher
|
||||
var/missile_speed = 2
|
||||
var/missile_range = 30
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/action(target)
|
||||
if(!action_checks(target))
|
||||
return
|
||||
var/obj/O = new projectile(chassis.loc)
|
||||
playsound(chassis, fire_sound, 50, 1)
|
||||
log_message("Launched a [O.name] from [name], targeting [target].")
|
||||
projectiles--
|
||||
proj_init(O)
|
||||
spawn(0)
|
||||
O.throw_at(target, missile_range, missile_speed, spin = 0)
|
||||
return 1
|
||||
|
||||
//used for projectile initilisation (priming flashbang) and additional logging
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/proc/proj_init(var/obj/O)
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/missile_rack
|
||||
name = "\improper SRM-8 missile rack"
|
||||
desc = "A weapon for combat exosuits. Shoots light explosive missiles."
|
||||
icon_state = "mecha_missilerack"
|
||||
@@ -293,24 +304,12 @@
|
||||
projectiles = 8
|
||||
projectile_energy_cost = 1000
|
||||
equip_cooldown = 60
|
||||
var/missile_speed = 2
|
||||
var/missile_range = 30
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/action(target)
|
||||
if(!action_checks(target)) return
|
||||
set_ready_state(0)
|
||||
var/obj/item/missile/M = new projectile(chassis.loc)
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/missile_rack/proj_init(var/obj/item/missile/M)
|
||||
M.primed = 1
|
||||
playsound(chassis, fire_sound, 50, 1)
|
||||
M.throw_at(target, missile_range, missile_speed)
|
||||
projectiles--
|
||||
log_message("Fired from [src.name], targeting [target].")
|
||||
var/turf/T = get_turf(src)
|
||||
message_admins("[key_name(chassis.occupant, chassis.occupant.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[chassis.occupant]'>?</A>) fired a [src] in ([T.x],[T.y],[T.z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[T.x];Y=[T.y];Z=[T.z]'>JMP</a>)",0,1)
|
||||
log_game("[key_name(chassis.occupant)] fired a [src] ([T.x],[T.y],[T.z])")
|
||||
do_after_cooldown()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/missile
|
||||
icon = 'icons/obj/grenade.dmi'
|
||||
@@ -324,9 +323,8 @@
|
||||
qdel(src)
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/flashbang
|
||||
name = "\improper SGL-6 grenade launcher"
|
||||
desc = "A weapon for combat exosuits. Launches primed flashbangs."
|
||||
icon_state = "mecha_grenadelnchr"
|
||||
@@ -338,24 +336,16 @@
|
||||
equip_cooldown = 60
|
||||
var/det_time = 20
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/action(target)
|
||||
if(!action_checks(target)) return
|
||||
set_ready_state(0)
|
||||
var/obj/item/weapon/grenade/flashbang/F = new projectile(chassis.loc)
|
||||
playsound(chassis, fire_sound, 50, 1)
|
||||
F.throw_at(target, missile_range, missile_speed)
|
||||
projectiles--
|
||||
log_message("Fired from [src.name], targeting [target].")
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/flashbang/proj_init(var/obj/item/weapon/grenade/flashbang/F)
|
||||
var/turf/T = get_turf(src)
|
||||
message_admins("[key_name(chassis.occupant, chassis.occupant.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[chassis.occupant]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[chassis.occupant]'>FLW</A>) fired a [src] in ([T.x],[T.y],[T.z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[T.x];Y=[T.y];Z=[T.z]'>JMP</a>)",0,1)
|
||||
message_admins("[key_name(chassis.occupant, chassis.occupant.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[chassis.occupant]'>?</A>) fired a [src] in ([T.x],[T.y],[T.z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[T.x];Y=[T.y];Z=[T.z]'>JMP</a>)",0,1)
|
||||
log_game("[key_name(chassis.occupant)] fired a [src] ([T.x],[T.y],[T.z])")
|
||||
spawn(det_time)
|
||||
if(F)
|
||||
F.prime()
|
||||
do_after_cooldown()
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang //Because I am a heartless bastard -Sieve //Heartless? for making the poor man's honkblast? - Kaze
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/flashbang/clusterbang //Because I am a heartless bastard -Sieve //Heartless? for making the poor man's honkblast? - Kaze
|
||||
name = "\improper SOB-3 grenade launcher"
|
||||
desc = "A weapon for combat exosuits. Launches primed clusterbangs. You monster."
|
||||
projectiles = 3
|
||||
@@ -363,7 +353,7 @@
|
||||
projectile_energy_cost = 1600 //getting off cheap seeing as this is 3 times the flashbangs held in the grenade launcher.
|
||||
equip_cooldown = 90
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/banana_mortar
|
||||
name = "banana mortar"
|
||||
desc = "Equipment for clown exosuits. Launches banana peels."
|
||||
icon_state = "mecha_bananamrtr"
|
||||
@@ -374,25 +364,13 @@
|
||||
projectile_energy_cost = 100
|
||||
equip_cooldown = 20
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar/can_attach(obj/mecha/combat/honker/M as obj)
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/banana_mortar/can_attach(obj/mecha/combat/honker/M as obj)
|
||||
if(..())
|
||||
if(istype(M))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar/action(target)
|
||||
if(!action_checks(target)) return
|
||||
set_ready_state(0)
|
||||
var/obj/item/weapon/grown/bananapeel/B = new projectile(chassis.loc,60)
|
||||
playsound(chassis, fire_sound, 60, 1)
|
||||
B.throw_at(target, missile_range, missile_speed)
|
||||
projectiles--
|
||||
log_message("Bananed from [src.name], targeting [target]. HONK!")
|
||||
do_after_cooldown()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/mousetrap_mortar
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/mousetrap_mortar
|
||||
name = "mousetrap mortar"
|
||||
desc = "Equipment for clown exosuits. Launches armed mousetraps."
|
||||
icon_state = "mecha_mousetrapmrtr"
|
||||
@@ -403,20 +381,12 @@
|
||||
projectile_energy_cost = 100
|
||||
equip_cooldown = 10
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/mousetrap_mortar/can_attach(obj/mecha/combat/honker/M as obj)
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/mousetrap_mortar/can_attach(obj/mecha/combat/honker/M as obj)
|
||||
if(..())
|
||||
if(istype(M))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/mousetrap_mortar/action(target)
|
||||
if(!action_checks(target)) return
|
||||
set_ready_state(0)
|
||||
var/obj/item/device/assembly/mousetrap/armed/M = new projectile(chassis.loc)
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/mousetrap_mortar/proj_init(var/obj/item/device/assembly/mousetrap/armed/M)
|
||||
M.secured = 1
|
||||
playsound(chassis, fire_sound, 60, 1)
|
||||
M.throw_at(target, missile_range, missile_speed)
|
||||
projectiles--
|
||||
log_message("Launched a mouse-trap from [src.name], targeting [target]. HONK!")
|
||||
do_after_cooldown()
|
||||
return
|
||||
|
||||
|
||||
+303
-1110
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,345 @@
|
||||
|
||||
/obj/mecha/proc/take_damage(amount, type="brute")
|
||||
if(amount)
|
||||
var/damage = absorbDamage(amount,type)
|
||||
health -= damage
|
||||
update_health()
|
||||
occupant_message("<span class='userdanger'>Taking damage!</span>")
|
||||
log_append_to_last("Took [damage] points of damage. Damage type: \"[type]\".",1)
|
||||
|
||||
/obj/mecha/proc/absorbDamage(damage,damage_type)
|
||||
var/coeff = 1
|
||||
if(damage_absorption[damage_type])
|
||||
coeff = damage_absorption[damage_type]
|
||||
return damage*coeff
|
||||
|
||||
|
||||
/obj/mecha/proc/update_health()
|
||||
if(src.health > 0)
|
||||
src.spark_system.start()
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
/obj/mecha/attack_hulk(mob/living/carbon/human/user)
|
||||
if(!prob(src.deflect_chance))
|
||||
..(user, 1)
|
||||
take_damage(15)
|
||||
check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
|
||||
user.visible_message("<span class='danger'>[user] hits [src.name], doing some damage.</span>", "<span class='danger'>You hit [src.name] with all your might. The metal creaks and bends.</span>")
|
||||
occupant_message("<span class='userdanger'>[user] hits [src.name], doing some damage.</span>")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/mecha/attack_hand(mob/living/user as mob)
|
||||
user.changeNext_move(CLICK_CD_MELEE) // Ugh. Ideally we shouldn't be setting cooldowns outside of click code.
|
||||
user.do_attack_animation(src)
|
||||
src.log_message("Attack by hand/paw. Attacker - [user].",1)
|
||||
user.visible_message("<span class='danger'>[user] hits [src.name]. Nothing happens</span>","<span class='danger'>You hit [src.name] with no visible effect.</span>")
|
||||
src.log_append_to_last("Armor saved.")
|
||||
return
|
||||
|
||||
/obj/mecha/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
/obj/mecha/attack_alien(mob/living/user as mob)
|
||||
src.log_message("Attack by alien. Attacker - [user].",1)
|
||||
user.changeNext_move(CLICK_CD_MELEE) //Now stompy alien killer mechs are actually scary to aliens!
|
||||
user.do_attack_animation(src)
|
||||
if(!prob(src.deflect_chance))
|
||||
take_damage(15)
|
||||
check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
|
||||
playsound(src.loc, 'sound/weapons/slash.ogg', 50, 1, -1)
|
||||
visible_message("<span class='danger'>The [user] slashes at [src.name]'s armor!</span>")
|
||||
else
|
||||
src.log_append_to_last("Armor saved.")
|
||||
playsound(src.loc, 'sound/weapons/slash.ogg', 50, 1, -1)
|
||||
user << "\green Your claws had no effect!"
|
||||
visible_message("<span class='notice'>The [user] rebounds off [src.name]'s armor!</span>")
|
||||
return
|
||||
|
||||
|
||||
/obj/mecha/attack_animal(mob/living/simple_animal/user as mob)
|
||||
src.log_message("Attack by simple animal. Attacker - [user].",1)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
if(user.melee_damage_upper == 0)
|
||||
user.emote("[user.friendly] [src]")
|
||||
else
|
||||
user.do_attack_animation(src)
|
||||
if(!prob(src.deflect_chance))
|
||||
var/damage = rand(user.melee_damage_lower, user.melee_damage_upper)
|
||||
take_damage(damage)
|
||||
check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
|
||||
visible_message("<span class='danger'>[user] [user.attacktext] [src]!</span>")
|
||||
add_logs(user, src, "attacked", admin=0)
|
||||
else
|
||||
src.log_append_to_last("Armor saved.")
|
||||
playsound(src.loc, 'sound/weapons/slash.ogg', 50, 1, -1)
|
||||
visible_message("<span class='notice'>The [user] rebounds off [src.name]'s armor!</span>")
|
||||
add_logs(user, src, "attacked", admin=0)
|
||||
return
|
||||
|
||||
/obj/mecha/attack_tk()
|
||||
return
|
||||
|
||||
/obj/mecha/hitby(atom/movable/A as mob|obj) //wrapper
|
||||
log_message("Hit by [A].",1)
|
||||
var/deflection = deflect_chance
|
||||
var/dam_coeff = 1
|
||||
var/counter_tracking = 0
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster/B in equipment)
|
||||
if(B.projectile_react())
|
||||
deflection *= B.deflect_coeff
|
||||
dam_coeff *= B.damage_coeff
|
||||
counter_tracking = 1
|
||||
break
|
||||
if(istype(A, /obj/item/mecha_parts/mecha_tracking))
|
||||
if(!counter_tracking)
|
||||
A.forceMove(src)
|
||||
visible_message("The [A] fastens firmly to [src].")
|
||||
return
|
||||
else
|
||||
deflection = 100 //will bounce off
|
||||
if(prob(deflection) || istype(A, /mob))
|
||||
visible_message("[A] bounces off the [src.name] armor")
|
||||
log_append_to_last("Armor saved.")
|
||||
if(istype(A, /mob/living))
|
||||
var/mob/living/M = A
|
||||
M.take_organ_damage(10)
|
||||
else if(istype(A, /obj))
|
||||
var/obj/O = A
|
||||
if(O.throwforce)
|
||||
visible_message("<span class='danger'>[src.name] is hit by [A].</span>")
|
||||
take_damage(O.throwforce*dam_coeff)
|
||||
check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
|
||||
return
|
||||
|
||||
|
||||
/obj/mecha/bullet_act(var/obj/item/projectile/Proj) //wrapper
|
||||
log_message("Hit by projectile. Type: [Proj.name]([Proj.flag]).",1)
|
||||
var/deflection = deflect_chance
|
||||
var/dam_coeff = 1
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster/B in equipment)
|
||||
if(B.projectile_react())
|
||||
deflection *= B.deflect_coeff
|
||||
dam_coeff *= B.damage_coeff
|
||||
break
|
||||
if(prob(deflection))
|
||||
visible_message("The [src.name] armor deflects the projectile")
|
||||
log_append_to_last("Armor saved.")
|
||||
return
|
||||
var/ignore_threshold
|
||||
if(Proj.flag == "taser")
|
||||
use_power(200)
|
||||
return
|
||||
if(istype(Proj, /obj/item/projectile/beam/pulse))
|
||||
ignore_threshold = 1
|
||||
if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
|
||||
take_damage(Proj.damage*dam_coeff,Proj.flag)
|
||||
visible_message("<span class='danger'>[src.name] is hit by [Proj].</span>")
|
||||
check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT),ignore_threshold)
|
||||
Proj.on_hit(src)
|
||||
|
||||
/obj/mecha/ex_act(severity, target)
|
||||
src.log_message("Affected by explosion of severity: [severity].",1)
|
||||
if(prob(src.deflect_chance))
|
||||
severity++
|
||||
log_append_to_last("Armor saved, changing severity to [severity].")
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
qdel(src)
|
||||
if(2.0)
|
||||
if (prob(30))
|
||||
qdel(src)
|
||||
else
|
||||
take_damage(initial(src.health)/2)
|
||||
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))
|
||||
qdel(src)
|
||||
else
|
||||
take_damage(initial(src.health)/5)
|
||||
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)
|
||||
return
|
||||
|
||||
/obj/mecha/blob_act()
|
||||
take_damage(30, "brute")
|
||||
return
|
||||
|
||||
/obj/mecha/emp_act(severity)
|
||||
if(get_charge())
|
||||
use_power((cell.charge/2)/severity)
|
||||
take_damage(50 / severity,"energy")
|
||||
src.log_message("EMP detected",1)
|
||||
check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT),1)
|
||||
return
|
||||
|
||||
/obj/mecha/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature>src.max_temperature)
|
||||
log_message("Exposed to dangerous temperature.",1)
|
||||
take_damage(5,"fire")
|
||||
check_for_internal_damage(list(MECHA_INT_FIRE, MECHA_INT_TEMP_CONTROL))
|
||||
return
|
||||
|
||||
|
||||
/obj/mecha/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
|
||||
if(istype(W, /obj/item/device/mmi))
|
||||
if(mmi_move_inside(W,user))
|
||||
user << "[src]-[W] interface initialized successfuly"
|
||||
else
|
||||
user << "[src]-[W] interface initialization failed."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/mecha_parts/mecha_equipment))
|
||||
var/obj/item/mecha_parts/mecha_equipment/E = W
|
||||
spawn()
|
||||
if(E.can_attach(src))
|
||||
if(!user.drop_item())
|
||||
return
|
||||
E.attach(src)
|
||||
user.visible_message("[user] attaches [W] to [src].", "<span class='notice'>You attach [W] to [src].</span>")
|
||||
else
|
||||
user << "<span class='warning'>You were unable to attach [W] to [src]!</span>"
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||
if(add_req_access || maint_access)
|
||||
if(internals_access_allowed(user))
|
||||
var/obj/item/weapon/card/id/id_card
|
||||
if(istype(W, /obj/item/weapon/card/id))
|
||||
id_card = W
|
||||
else
|
||||
var/obj/item/device/pda/pda = W
|
||||
id_card = pda.id
|
||||
output_maintenance_dialog(id_card, user)
|
||||
return
|
||||
else
|
||||
user << "<span class='warning'>Invalid ID: Access denied.</span>"
|
||||
else
|
||||
user << "<span class='warning'>Maintenance protocols disabled by operator.</span>"
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
if(state==1)
|
||||
state = 2
|
||||
user << "<span class='notice'>You undo the securing bolts.</span>"
|
||||
else if(state==2)
|
||||
state = 1
|
||||
user << "<span class='notice'>You tighten the securing bolts.</span>"
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/crowbar))
|
||||
if(state==2)
|
||||
state = 3
|
||||
user << "<span class='notice'>You open the hatch to the power unit.</span>"
|
||||
else if(state==3)
|
||||
state=2
|
||||
user << "<span class='notice'>You close the hatch to the power unit.</span>"
|
||||
return
|
||||
else if(istype(W, /obj/item/stack/cable_coil))
|
||||
if(state == 3 && (internal_damage & MECHA_INT_SHORT_CIRCUIT))
|
||||
var/obj/item/stack/cable_coil/CC = W
|
||||
if(CC.use(2))
|
||||
clearInternalDamage(MECHA_INT_SHORT_CIRCUIT)
|
||||
user << "<span class='notice'>You replace the fused wires.</span>"
|
||||
else
|
||||
user << "<span class='warning'>You need two lengths of cable to fix this mech!</span>"
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if(internal_damage & MECHA_INT_TEMP_CONTROL)
|
||||
clearInternalDamage(MECHA_INT_TEMP_CONTROL)
|
||||
user << "<span class='notice'>You repair the damaged temperature controller.</span>"
|
||||
else if(state==3 && src.cell)
|
||||
src.cell.forceMove(src.loc)
|
||||
src.cell = null
|
||||
state = 4
|
||||
user << "<span class='notice'>You unscrew and pry out the powercell.</span>"
|
||||
src.log_message("Powercell removed")
|
||||
else if(state==4 && src.cell)
|
||||
state=3
|
||||
user << "<span class='notice'>You screw the cell in place.</span>"
|
||||
return
|
||||
|
||||
else if(istype(W, /obj/item/weapon/stock_parts/cell))
|
||||
if(state==4)
|
||||
if(!src.cell)
|
||||
if(!user.drop_item())
|
||||
return
|
||||
var/obj/item/weapon/stock_parts/cell/C = W
|
||||
user << "<span class='notice'>You install the powercell.</span>"
|
||||
C.forceMove(src)
|
||||
C.use(C.charge * 0.8)
|
||||
src.cell = C
|
||||
src.log_message("Powercell installed")
|
||||
else
|
||||
user << "<span class='notice'>There's already a powercell installed.</span>"
|
||||
return
|
||||
|
||||
else if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent != "harm")
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(src.health<initial(src.health))
|
||||
if (WT.remove_fuel(0,user))
|
||||
if (internal_damage & MECHA_INT_TANK_BREACH)
|
||||
clearInternalDamage(MECHA_INT_TANK_BREACH)
|
||||
user << "<span class='notice'>You repair the damaged gas tank.</span>"
|
||||
else
|
||||
user.visible_message("<span class='notice'>[user] repairs some damage to [src.name].</span>")
|
||||
src.health += min(10, initial(src.health)-src.health)
|
||||
else
|
||||
user << "<span class='warning'>The welder must be on for this task!</span>"
|
||||
return 1
|
||||
else
|
||||
user << "<span class='warning'>The [src.name] is at full integrity!</span>"
|
||||
return 1
|
||||
|
||||
else if(istype(W, /obj/item/mecha_parts/mecha_tracking))
|
||||
if(!user.unEquip(W))
|
||||
user << "<span class='warning'>\the [W] is stuck to your hand, you cannot put it in \the [src]!</span>"
|
||||
return
|
||||
W.forceMove(src)
|
||||
user.visible_message("[user] attaches [W] to [src].", "<span class='notice'>You attach [W] to [src].</span>")
|
||||
return
|
||||
|
||||
else if(!(W.flags&NOBLUDGEON))
|
||||
user.changeNext_move(CLICK_CD_MELEE) // Ugh. Ideally we shouldn't be setting cooldowns outside of click code.
|
||||
user.do_attack_animation(src)
|
||||
log_message("Attacked by [W]. Attacker - [user]")
|
||||
var/deflection = deflect_chance
|
||||
var/dam_coeff = 1
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/anticcw_armor_booster/B in equipment)
|
||||
if(B.attack_react(user))
|
||||
deflection *= B.deflect_coeff
|
||||
dam_coeff *= B.damage_coeff
|
||||
break
|
||||
if(prob(deflection))
|
||||
user << "<span class='danger'>The [W] bounces off [src.name] armor.</span>"
|
||||
src.log_append_to_last("Armor saved.")
|
||||
return 0
|
||||
else
|
||||
user.visible_message("<span class='danger'>[user] hits [src] with [W].</span>", "<span class='danger'>You hit [src] with [W].</span>")
|
||||
take_damage(round(W.force*dam_coeff),W.damtype)
|
||||
check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
|
||||
return 1
|
||||
|
||||
|
||||
/obj/mecha/proc/mech_toxin_damage(mob/living/target)
|
||||
playsound(src, 'sound/effects/spray2.ogg', 50, 1)
|
||||
if(target.reagents)
|
||||
if(target.reagents.get_reagent_amount("cryptobiolin") + force < force*2)
|
||||
target.reagents.add_reagent("cryptobiolin", force/2)
|
||||
if(target.reagents.get_reagent_amount("toxin") + force < force*2)
|
||||
target.reagents.add_reagent("toxin", force/2.5)
|
||||
|
||||
|
||||
/atom/proc/mech_melee_attack(obj/mecha/M)
|
||||
return
|
||||
|
||||
/obj/mecha/mech_melee_attack(obj/mecha/M)
|
||||
if(M.damtype =="brute")
|
||||
playsound(src, 'sound/weapons/punch4.ogg', 50, 1)
|
||||
else if(M.damtype == "fire")
|
||||
playsound(src, 'sound/items/Welder.ogg', 50, 1)
|
||||
else
|
||||
return
|
||||
visible_message("<span class='danger'>[M.name] has hit [src].</span>")
|
||||
take_damage(M.force, damtype)
|
||||
add_logs(M.occupant, src, "attacked", object=M, addition="(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])")
|
||||
return
|
||||
@@ -175,27 +175,7 @@
|
||||
/obj/item/mecha_parts/chassis/firefighter/New()
|
||||
..()
|
||||
construct = new /datum/construction/mecha/firefighter_chassis(src)
|
||||
/*
|
||||
/obj/item/mecha_parts/part/firefighter_torso
|
||||
name="Ripley-on-Fire Torso"
|
||||
icon_state = "ripley_harness"
|
||||
|
||||
/obj/item/mecha_parts/part/firefighter_left_arm
|
||||
name="Ripley-on-Fire Left Arm"
|
||||
icon_state = "ripley_l_arm"
|
||||
|
||||
/obj/item/mecha_parts/part/firefighter_right_arm
|
||||
name="Ripley-on-Fire Right Arm"
|
||||
icon_state = "ripley_r_arm"
|
||||
|
||||
/obj/item/mecha_parts/part/firefighter_left_leg
|
||||
name="Ripley-on-Fire Left Leg"
|
||||
icon_state = "ripley_l_leg"
|
||||
|
||||
/obj/item/mecha_parts/part/firefighter_right_leg
|
||||
name="Ripley-on-Fire Right Leg"
|
||||
icon_state = "ripley_r_leg"
|
||||
*/
|
||||
|
||||
////////// HONK
|
||||
|
||||
@@ -334,13 +314,6 @@
|
||||
icon_state = "odysseus_r_leg"
|
||||
origin_tech = "programming=2;materials=2;engineering=2"
|
||||
|
||||
/*/obj/item/mecha_parts/part/odysseus_armor
|
||||
name="Odysseus Carapace"
|
||||
icon_state = "odysseus_armor"
|
||||
origin_tech = "materials=3;engineering=3"
|
||||
construction_time = 200
|
||||
construction_cost = list("metal"=15000)*/
|
||||
|
||||
|
||||
///////// Circuitboards
|
||||
|
||||
|
||||
@@ -0,0 +1,321 @@
|
||||
|
||||
////////////////////////////////////
|
||||
///// Rendering stats window ///////
|
||||
////////////////////////////////////
|
||||
|
||||
/obj/mecha/proc/get_stats_html()
|
||||
var/output = {"<html>
|
||||
<head><title>[src.name] data</title>
|
||||
<style>
|
||||
body {color: #00ff00; background: #000000; font-family:"Lucida Console",monospace; font-size: 12px;}
|
||||
hr {border: 1px solid #0f0; color: #0f0; background-color: #0f0;}
|
||||
a {padding:2px 5px;;color:#0f0;}
|
||||
.wr {margin-bottom: 5px;}
|
||||
.header {cursor:pointer;}
|
||||
.open, .closed {background: #32CD32; color:#000; padding:1px 2px;}
|
||||
.links a {margin-bottom: 2px;padding-top:3px;}
|
||||
.visible {display: block;}
|
||||
.hidden {display: none;}
|
||||
</style>
|
||||
<script language='javascript' type='text/javascript'>
|
||||
[js_byjax]
|
||||
[js_dropdowns]
|
||||
function ticker() {
|
||||
setInterval(function(){
|
||||
window.location='byond://?src=\ref[src]&update_content=1';
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
dropdowns();
|
||||
ticker();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id='content'>
|
||||
[src.get_stats_part()]
|
||||
</div>
|
||||
<div id='eq_list'>
|
||||
[src.get_equipment_list()]
|
||||
</div>
|
||||
<hr>
|
||||
<div id='commands'>
|
||||
[src.get_commands()]
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
"}
|
||||
return output
|
||||
|
||||
|
||||
/obj/mecha/proc/report_internal_damage()
|
||||
var/output = null
|
||||
var/list/dam_reports = list(
|
||||
"[MECHA_INT_FIRE]" = "<span class='userdanger'>INTERNAL FIRE</span>",
|
||||
"[MECHA_INT_TEMP_CONTROL]" = "<span class='userdanger'>LIFE SUPPORT SYSTEM MALFUNCTION</span>",
|
||||
"[MECHA_INT_TANK_BREACH]" = "<span class='userdanger'>GAS TANK BREACH</span>",
|
||||
"[MECHA_INT_CONTROL_LOST]" = "<span class='userdanger'>COORDINATION SYSTEM CALIBRATION FAILURE</span> - <a href='?src=\ref[src];repair_int_control_lost=1'>Recalibrate</a>",
|
||||
"[MECHA_INT_SHORT_CIRCUIT]" = "<span class='userdanger'>SHORT CIRCUIT</span>"
|
||||
)
|
||||
for(var/tflag in dam_reports)
|
||||
var/intdamflag = text2num(tflag)
|
||||
if(internal_damage & intdamflag)
|
||||
output += dam_reports[tflag]
|
||||
output += "<br />"
|
||||
if(return_pressure() > WARNING_HIGH_PRESSURE)
|
||||
output += "<span class='userdanger'>DANGEROUSLY HIGH CABIN PRESSURE</span><br />"
|
||||
return output
|
||||
|
||||
|
||||
/obj/mecha/proc/get_stats_part()
|
||||
var/integrity = health/initial(health)*100
|
||||
var/cell_charge = get_charge()
|
||||
var/tank_pressure = internal_tank ? round(internal_tank.return_pressure(),0.01) : "None"
|
||||
var/tank_temperature = internal_tank ? internal_tank.return_temperature() : "Unknown"
|
||||
var/cabin_pressure = round(return_pressure(),0.01)
|
||||
var/output = {"[report_internal_damage()]
|
||||
[integrity<30?"<span class='userdanger'>DAMAGE LEVEL CRITICAL</span><br>":null]
|
||||
<b>Integrity: </b> [integrity]%<br>
|
||||
<b>Powercell charge: </b>[isnull(cell_charge)?"No powercell installed":"[cell.percent()]%"]<br>
|
||||
<b>Air source: </b>[use_internal_tank?"Internal Airtank":"Environment"]<br>
|
||||
<b>Airtank pressure: </b>[tank_pressure]kPa<br>
|
||||
<b>Airtank temperature: </b>[tank_temperature]°K|[tank_temperature - T0C]°C<br>
|
||||
<b>Cabin pressure: </b>[cabin_pressure>WARNING_HIGH_PRESSURE ? "<span class='danger'>[cabin_pressure]</span>": cabin_pressure]kPa<br>
|
||||
<b>Cabin temperature: </b> [return_temperature()]°K|[return_temperature() - T0C]°C<br>
|
||||
[src.dna?"<b>DNA-locked:</b><br> <span style='font-size:10px;letter-spacing:-1px;'>[src.dna]</span> \[<a href='?src=\ref[src];reset_dna=1'>Reset</a>\]<br>":null]
|
||||
"}
|
||||
return output
|
||||
|
||||
/obj/mecha/proc/get_commands()
|
||||
var/output = {"<div class='wr'>
|
||||
<div class='header'>Electronics</div>
|
||||
<div class='links'>
|
||||
<b>Radio settings:</b><br>
|
||||
Microphone: <a href='?src=\ref[src];rmictoggle=1'><span id="rmicstate">[radio.broadcasting?"Engaged":"Disengaged"]</span></a><br>
|
||||
Speaker: <a href='?src=\ref[src];rspktoggle=1'><span id="rspkstate">[radio.listening?"Engaged":"Disengaged"]</span></a><br>
|
||||
Frequency:
|
||||
<a href='?src=\ref[src];rfreq=-10'>-</a>
|
||||
<a href='?src=\ref[src];rfreq=-2'>-</a>
|
||||
<span id="rfreq">[format_frequency(radio.frequency)]</span>
|
||||
<a href='?src=\ref[src];rfreq=2'>+</a>
|
||||
<a href='?src=\ref[src];rfreq=10'>+</a><br>
|
||||
</div>
|
||||
</div>
|
||||
<div class='wr'>
|
||||
<div class='header'>Permissions & Logging</div>
|
||||
<div class='links'>
|
||||
<a href='?src=\ref[src];toggle_id_upload=1'><span id='t_id_upload'>[add_req_access?"L":"Unl"]ock ID upload panel</span></a><br>
|
||||
<a href='?src=\ref[src];toggle_maint_access=1'><span id='t_maint_access'>[maint_access?"Forbid":"Permit"] maintenance protocols</span></a><br>
|
||||
<a href='?src=\ref[src];dna_lock=1'>DNA-lock</a><br>
|
||||
<a href='?src=\ref[src];view_log=1'>View internal log</a><br>
|
||||
<a href='?src=\ref[src];change_name=1'>Change exosuit name</a><br>
|
||||
</div>
|
||||
</div>
|
||||
<div id='equipment_menu'>[get_equipment_menu()]</div>
|
||||
"}
|
||||
return output
|
||||
|
||||
/obj/mecha/proc/get_equipment_menu() //outputs mecha html equipment menu
|
||||
var/output
|
||||
if(equipment.len)
|
||||
output += {"<div class='wr'>
|
||||
<div class='header'>Equipment</div>
|
||||
<div class='links'>"}
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/W in equipment)
|
||||
output += "[W.name] <a href='?src=\ref[W];detach=1'>Detach</a><br>"
|
||||
output += "<b>Available equipment slots:</b> [max_equip-equipment.len]"
|
||||
output += "</div></div>"
|
||||
return output
|
||||
|
||||
/obj/mecha/proc/get_equipment_list() //outputs mecha equipment list in html
|
||||
if(!equipment.len)
|
||||
return
|
||||
var/output = "<b>Equipment:</b><div style=\"margin-left: 15px;\">"
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/MT in equipment)
|
||||
output += "<div id='\ref[MT]'>[MT.get_equip_info()]</div>"
|
||||
output += "</div>"
|
||||
return output
|
||||
|
||||
|
||||
/obj/mecha/proc/get_log_html()
|
||||
var/output = "<html><head><title>[src.name] Log</title></head><body style='font: 13px 'Courier', monospace;'>"
|
||||
for(var/list/entry in log)
|
||||
output += {"<div style='font-weight: bold;'>[entry["time"]] [time2text(entry["date"],"MMM DD")] [entry["year"]]</div>
|
||||
<div style='margin-left:15px; margin-bottom:10px;'>[entry["message"]]</div>
|
||||
"}
|
||||
output += "</body></html>"
|
||||
return output
|
||||
|
||||
|
||||
/obj/mecha/proc/output_access_dialog(obj/item/weapon/card/id/id_card, mob/user)
|
||||
if(!id_card || !user) return
|
||||
var/output = {"<html>
|
||||
<head><style>
|
||||
h1 {font-size:15px;margin-bottom:4px;}
|
||||
body {color: #00ff00; background: #000000; font-family:"Courier New", Courier, monospace; font-size: 12px;}
|
||||
a {color:#0f0;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Following keycodes are present in this system:</h1>"}
|
||||
for(var/a in operation_req_access)
|
||||
output += "[get_access_desc(a)] - <a href='?src=\ref[src];del_req_access=[a];user=\ref[user];id_card=\ref[id_card]'>Delete</a><br>"
|
||||
output += "<hr><h1>Following keycodes were detected on portable device:</h1>"
|
||||
for(var/a in id_card.access)
|
||||
if(a in operation_req_access) continue
|
||||
var/a_name = get_access_desc(a)
|
||||
if(!a_name) continue //there's some strange access without a name
|
||||
output += "[a_name] - <a href='?src=\ref[src];add_req_access=[a];user=\ref[user];id_card=\ref[id_card]'>Add</a><br>"
|
||||
output += "<hr><a href='?src=\ref[src];finish_req_access=1;user=\ref[user]'>Finish</a> <span class='danger'>(Warning! The ID upload panel will be locked. It can be unlocked only through Exosuit Interface.)</span>"
|
||||
output += "</body></html>"
|
||||
user << browse(output, "window=exosuit_add_access")
|
||||
onclose(user, "exosuit_add_access")
|
||||
return
|
||||
|
||||
/obj/mecha/proc/output_maintenance_dialog(obj/item/weapon/card/id/id_card,mob/user)
|
||||
if(!id_card || !user) return
|
||||
var/output = {"<html>
|
||||
<head>
|
||||
<style>
|
||||
body {color: #00ff00; background: #000000; font-family:"Courier New", Courier, monospace; font-size: 12px;}
|
||||
a {padding:2px 5px; background:#32CD32;color:#000;display:block;margin:2px;text-align:center;text-decoration:none;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
[add_req_access?"<a href='?src=\ref[src];req_access=1;id_card=\ref[id_card];user=\ref[user]'>Edit operation keycodes</a>":null]
|
||||
[maint_access?"<a href='?src=\ref[src];maint_access=1;id_card=\ref[id_card];user=\ref[user]'>Initiate maintenance protocol</a>":null]
|
||||
[(state>0) ?"<a href='?src=\ref[src];set_internal_tank_valve=1;user=\ref[user]'>Set Cabin Air Pressure</a>":null]
|
||||
</body>
|
||||
</html>"}
|
||||
user << browse(output, "window=exosuit_maint_console")
|
||||
onclose(user, "exosuit_maint_console")
|
||||
return
|
||||
|
||||
|
||||
|
||||
/////////////////
|
||||
///// Topic /////
|
||||
/////////////////
|
||||
|
||||
/obj/mecha/Topic(href, href_list)
|
||||
..()
|
||||
if(href_list["close"])
|
||||
return
|
||||
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
|
||||
var/datum/topic_input/filter = new /datum/topic_input(href,href_list)
|
||||
|
||||
if(in_range(src, usr))
|
||||
|
||||
if(href_list["req_access"] && add_req_access)
|
||||
output_access_dialog(filter.getObj("id_card"),filter.getMob("user"))
|
||||
|
||||
if(href_list["maint_access"] && maint_access)
|
||||
var/mob/user = filter.getMob("user")
|
||||
if(user)
|
||||
if(state==0)
|
||||
state = 1
|
||||
user << "The securing bolts are now exposed."
|
||||
else if(state==1)
|
||||
state = 0
|
||||
user << "The securing bolts are now hidden."
|
||||
output_maintenance_dialog(filter.getObj("id_card"),user)
|
||||
|
||||
if(href_list["set_internal_tank_valve"] && state >=1)
|
||||
var/mob/user = filter.getMob("user")
|
||||
if(user)
|
||||
var/new_pressure = input(user,"Input new output pressure","Pressure setting",internal_tank_valve) as num
|
||||
if(new_pressure)
|
||||
internal_tank_valve = new_pressure
|
||||
user << "The internal pressure valve has been set to [internal_tank_valve]kPa."
|
||||
|
||||
if(href_list["add_req_access"] && add_req_access && filter.getObj("id_card"))
|
||||
operation_req_access += filter.getNum("add_req_access")
|
||||
output_access_dialog(filter.getObj("id_card"),filter.getMob("user"))
|
||||
|
||||
if(href_list["del_req_access"] && add_req_access && filter.getObj("id_card"))
|
||||
operation_req_access -= filter.getNum("del_req_access")
|
||||
output_access_dialog(filter.getObj("id_card"),filter.getMob("user"))
|
||||
|
||||
if(href_list["finish_req_access"])
|
||||
add_req_access = 0
|
||||
var/mob/user = filter.getMob("user")
|
||||
user << browse(null,"window=exosuit_add_access")
|
||||
|
||||
if(usr != occupant)
|
||||
return
|
||||
|
||||
if(href_list["update_content"])
|
||||
send_byjax(src.occupant,"exosuit.browser","content",src.get_stats_part())
|
||||
|
||||
if(href_list["select_equip"])
|
||||
var/obj/item/mecha_parts/mecha_equipment/equip = filter.getObj("select_equip")
|
||||
if(equip)
|
||||
src.selected = equip
|
||||
src.occupant_message("You switch to [equip]")
|
||||
src.visible_message("[src] raises [equip]")
|
||||
send_byjax(src.occupant,"exosuit.browser","eq_list",src.get_equipment_list())
|
||||
|
||||
if(href_list["rmictoggle"])
|
||||
radio.broadcasting = !radio.broadcasting
|
||||
send_byjax(src.occupant,"exosuit.browser","rmicstate",(radio.broadcasting?"Engaged":"Disengaged"))
|
||||
|
||||
if(href_list["rspktoggle"])
|
||||
radio.listening = !radio.listening
|
||||
send_byjax(src.occupant,"exosuit.browser","rspkstate",(radio.listening?"Engaged":"Disengaged"))
|
||||
|
||||
if(href_list["rfreq"])
|
||||
var/new_frequency = (radio.frequency + filter.getNum("rfreq"))
|
||||
if (!radio.freerange || (radio.frequency < 1200 || radio.frequency > 1600))
|
||||
new_frequency = sanitize_frequency(new_frequency)
|
||||
radio.set_frequency(new_frequency)
|
||||
send_byjax(src.occupant,"exosuit.browser","rfreq","[format_frequency(radio.frequency)]")
|
||||
|
||||
if (href_list["view_log"])
|
||||
src.occupant << browse(src.get_log_html(), "window=exosuit_log")
|
||||
onclose(occupant, "exosuit_log")
|
||||
|
||||
if (href_list["change_name"])
|
||||
var/newname = stripped_input(occupant,"Choose new exosuit name","Rename exosuit","", MAX_NAME_LEN)
|
||||
if(newname && trim(newname))
|
||||
name = newname
|
||||
else
|
||||
alert(occupant, "nope.avi")
|
||||
|
||||
if (href_list["toggle_id_upload"])
|
||||
add_req_access = !add_req_access
|
||||
send_byjax(src.occupant,"exosuit.browser","t_id_upload","[add_req_access?"L":"Unl"]ock ID upload panel")
|
||||
|
||||
if(href_list["toggle_maint_access"])
|
||||
if(state)
|
||||
occupant_message("<span class='danger'>Maintenance protocols in effect</span>")
|
||||
return
|
||||
maint_access = !maint_access
|
||||
send_byjax(src.occupant,"exosuit.browser","t_maint_access","[maint_access?"Forbid":"Permit"] maintenance protocols")
|
||||
|
||||
if(href_list["dna_lock"])
|
||||
if(occupant && !iscarbon(occupant))
|
||||
occupant << "<span class='danger'> You do not have any DNA!</span>"
|
||||
return
|
||||
dna = src.occupant.dna.unique_enzymes
|
||||
occupant_message("You feel a prick as the needle takes your DNA sample.")
|
||||
|
||||
if(href_list["reset_dna"])
|
||||
dna = null
|
||||
|
||||
if(href_list["repair_int_control_lost"])
|
||||
occupant_message("Recalibrating coordination system...")
|
||||
log_message("Recalibration of coordination system started.")
|
||||
var/T = loc
|
||||
spawn(100)
|
||||
if(T == loc)
|
||||
clearInternalDamage(MECHA_INT_CONTROL_LOST)
|
||||
occupant_message("<span class='notice'>Recalibration successful.</span>")
|
||||
log_message("Recalibration of coordination system finished with 0 errors.")
|
||||
else
|
||||
occupant_message("<span class='warning'>Recalibration failed!</span>")
|
||||
log_message("Recalibration of coordination system failed with 1 error.",1)
|
||||
|
||||
@@ -13,15 +13,9 @@
|
||||
var/list/cargo = new
|
||||
var/cargo_capacity = 15
|
||||
|
||||
/*
|
||||
/obj/mecha/working/ripley/New()
|
||||
..()
|
||||
return
|
||||
*/
|
||||
|
||||
/obj/mecha/working/ripley/Move()
|
||||
. = ..()
|
||||
if(. && (locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in equipment))
|
||||
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)
|
||||
for(var/obj/item/weapon/ore/ore in get_turf(src))
|
||||
@@ -29,10 +23,11 @@
|
||||
update_pressure()
|
||||
|
||||
/obj/mecha/working/ripley/Destroy()
|
||||
while(src.damage_absorption.["brute"] < 0.6)
|
||||
new /obj/item/asteroid/goliath_hide(src.loc)
|
||||
src.damage_absorption.["brute"] = src.damage_absorption.["brute"] + 0.1 //If a goliath-plated ripley gets killed, all the plates drop
|
||||
for(var/atom/movable/A in src.cargo)
|
||||
var/hides = round((initial(damage_absorption["brute"]) - damage_absorption["brute"])*10)
|
||||
for(var/i=0, i < hides, i++)
|
||||
new /obj/item/asteroid/goliath_hide(loc) //If a goliath-plated ripley gets killed, all the plates drop
|
||||
damage_absorption["brute"] = initial(damage_absorption["brute"])
|
||||
for(var/atom/movable/A in cargo)
|
||||
A.loc = loc
|
||||
step_rand(A)
|
||||
cargo.Cut()
|
||||
@@ -40,30 +35,25 @@
|
||||
|
||||
/obj/mecha/working/ripley/go_out()
|
||||
..()
|
||||
if (src.damage_absorption["brute"] < 0.6 && src.damage_absorption["brute"] > 0.3)
|
||||
src.overlays = null
|
||||
src.overlays += image("icon" = "mecha.dmi", "icon_state" = "ripley-g-open")
|
||||
else if (src.damage_absorption.["brute"] == 0.3)
|
||||
src.overlays = null
|
||||
src.overlays += image("icon" = "mecha.dmi", "icon_state" = "ripley-g-full-open")
|
||||
update_icon()
|
||||
|
||||
/obj/mecha/working/ripley/moved_inside(var/mob/living/carbon/human/H as mob)
|
||||
..()
|
||||
if (src.damage_absorption["brute"] < 0.6 && src.damage_absorption["brute"] > 0.3)
|
||||
src.overlays = null
|
||||
src.overlays += image("icon" = "mecha.dmi", "icon_state" = "ripley-g")
|
||||
else if (src.damage_absorption["brute"] == 0.3)
|
||||
src.overlays = null
|
||||
src.overlays += image("icon" = "mecha.dmi", "icon_state" = "ripley-g-full")
|
||||
update_icon()
|
||||
|
||||
/obj/mecha/working/ripley/mmi_moved_inside(var/obj/item/device/mmi/mmi_as_oc as obj,mob/user as mob)
|
||||
..()
|
||||
if (src.damage_absorption["brute"] < 0.6 && src.damage_absorption["brute"] > 0.3)
|
||||
src.overlays = null
|
||||
src.overlays += image("icon" = "mecha.dmi", "icon_state" = "ripley-g")
|
||||
else if (src.damage_absorption["brute"] == 0.3)
|
||||
src.overlays = null
|
||||
src.overlays += image("icon" = "mecha.dmi", "icon_state" = "ripley-g-full")
|
||||
update_icon()
|
||||
|
||||
/obj/mecha/working/ripley/update_icon()
|
||||
..()
|
||||
if (damage_absorption["brute"] < 0.6 && damage_absorption["brute"] > 0.3)
|
||||
overlays = null
|
||||
overlays += image("icon" = "mecha.dmi", "icon_state" = "ripley-g-open")
|
||||
else if (damage_absorption.["brute"] == 0.3)
|
||||
overlays = null
|
||||
overlays += image("icon" = "mecha.dmi", "icon_state" = "ripley-g-full-open")
|
||||
|
||||
|
||||
/obj/mecha/working/ripley/firefighter
|
||||
desc = "Autonomous Power Loader Unit. This model is refitted with additional thermal protection."
|
||||
@@ -76,6 +66,7 @@
|
||||
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"
|
||||
@@ -88,7 +79,7 @@
|
||||
|
||||
/obj/mecha/working/ripley/deathripley/New()
|
||||
..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/tool/safety_clamp
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/kill
|
||||
ME.attach(src)
|
||||
return
|
||||
|
||||
@@ -100,10 +91,10 @@
|
||||
..()
|
||||
//Attach drill
|
||||
if(prob(25)) //Possible diamond drill... Feeling lucky?
|
||||
var/obj/item/mecha_parts/mecha_equipment/tool/drill/diamonddrill/D = new /obj/item/mecha_parts/mecha_equipment/tool/drill/diamonddrill
|
||||
var/obj/item/mecha_parts/mecha_equipment/drill/diamonddrill/D = new /obj/item/mecha_parts/mecha_equipment/drill/diamonddrill
|
||||
D.attach(src)
|
||||
else
|
||||
var/obj/item/mecha_parts/mecha_equipment/tool/drill/D = new /obj/item/mecha_parts/mecha_equipment/tool/drill
|
||||
var/obj/item/mecha_parts/mecha_equipment/drill/D = new /obj/item/mecha_parts/mecha_equipment/drill
|
||||
D.attach(src)
|
||||
|
||||
//Add possible plasma cutter
|
||||
@@ -115,12 +106,12 @@
|
||||
cargo.Add(new /obj/structure/ore_box(src))
|
||||
|
||||
//Attach hydraulic clamp
|
||||
var/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp/HC = new /obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp
|
||||
var/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/HC = new /obj/item/mecha_parts/mecha_equipment/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
|
||||
qdel(B)
|
||||
|
||||
var/obj/item/mecha_parts/mecha_equipment/tool/mining_scanner/scanner = new /obj/item/mecha_parts/mecha_equipment/tool/mining_scanner
|
||||
var/obj/item/mecha_parts/mecha_equipment/mining_scanner/scanner = new /obj/item/mecha_parts/mecha_equipment/mining_scanner
|
||||
scanner.attach(src)
|
||||
|
||||
/obj/mecha/working/ripley/Exit(atom/movable/O)
|
||||
@@ -159,9 +150,9 @@
|
||||
|
||||
if(pressure < 20)
|
||||
step_in = 3
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/tool/drill/drill in equipment)
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/drill/drill in equipment)
|
||||
drill.equip_cooldown = initial(drill.equip_cooldown)/2
|
||||
else
|
||||
step_in = 5
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/tool/drill/drill in equipment)
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/drill/drill in equipment)
|
||||
drill.equip_cooldown = initial(drill.equip_cooldown)
|
||||
|
||||
@@ -430,7 +430,7 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s
|
||||
/obj/item/singularity_pull(S, current_size)
|
||||
spawn(0) //this is needed or multiple items will be thrown sequentially and not simultaneously
|
||||
if(current_size >= STAGE_FOUR)
|
||||
throw_at(S,14,3)
|
||||
throw_at(S,14,3, spin=0)
|
||||
else ..()
|
||||
|
||||
/obj/item/acid_act(var/acidpwr, var/acid_volume)
|
||||
|
||||
@@ -243,7 +243,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
|
||||
/obj/item/device/pda/proc/can_use(mob/user)
|
||||
if(user && ismob(user))
|
||||
if(user.stat || user.restrained() || user.paralysis || user.stunned || user.weakened)
|
||||
if(user.incapacitated())
|
||||
return 0
|
||||
if(loc == user)
|
||||
return 1
|
||||
|
||||
@@ -398,7 +398,7 @@ var/list/TYPES_SHORTCUTS = list(
|
||||
/obj/item/weapon/reagent_containers = "REAGENT_CONTAINERS",
|
||||
/obj/machinery/atmospherics = "ATMOS",
|
||||
/obj/machinery/portable_atmospherics = "PORT_ATMOS",
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack = "MECHA_MISSILE_RACK",
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/missile_rack = "MECHA_MISSILE_RACK",
|
||||
/obj/item/mecha_parts/mecha_equipment = "MECHA_EQUIP",
|
||||
)
|
||||
|
||||
|
||||
@@ -487,7 +487,7 @@ var/global/list/rockTurfEdgeCache
|
||||
return
|
||||
/* else if(istype(AM,/obj/mecha))
|
||||
var/obj/mecha/M = AM
|
||||
if(istype(M.selected,/obj/item/mecha_parts/mecha_equipment/tool/drill))
|
||||
if(istype(M.selected,/obj/item/mecha_parts/mecha_equipment/drill))
|
||||
src.attackby(M.selected,M)
|
||||
return*/
|
||||
//Aparantly mechs are just TOO COOL to call Bump(), so fuck em (for now)
|
||||
|
||||
@@ -72,7 +72,10 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds
|
||||
else
|
||||
affected_mob.overlays += image('icons/mob/alien.dmi', loc = affected_mob, icon_state = "burst_stand")
|
||||
spawn(6)
|
||||
var/mob/living/carbon/alien/larva/new_xeno = new(affected_mob.loc)
|
||||
var/location = get_turf(affected_mob)
|
||||
if(!location)
|
||||
location = affected_mob.loc
|
||||
var/mob/living/carbon/alien/larva/new_xeno = new(location)
|
||||
new_xeno.key = C.key
|
||||
new_xeno << sound('sound/voice/hiss5.ogg',0,0,0,100) //To get the player's attention
|
||||
if(gib_on_success)
|
||||
|
||||
@@ -10,10 +10,12 @@
|
||||
src.reset_view(null)
|
||||
src.unset_machine()
|
||||
|
||||
src.updatehealth()
|
||||
updatehealth()
|
||||
|
||||
update_gravity(mob_has_gravity())
|
||||
|
||||
update_action_buttons()
|
||||
|
||||
if (src.malfhack)
|
||||
if (src.malfhack.aidisabled)
|
||||
src << "<span class='danger'>ERROR: APC access disabled, hack attempt canceled.</span>"
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
var/last_failed_movement = 0//Will not move in the same dir if it couldnt before, will help with the getting stuck on fields thing
|
||||
var/last_warning
|
||||
var/consumedSupermatter = 0 //If the singularity has eaten a supermatter shard and can go to stage six
|
||||
allow_spin = 0
|
||||
|
||||
/obj/singularity/New(loc, var/starting_energy = 50, var/temp = 0)
|
||||
//CARN: admin-alert for chuckle-fuckery.
|
||||
admin_investigate_setup()
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
id = "mech_grenade_launcher"
|
||||
build_type = MECHFAB
|
||||
req_tech = list("combat" = 3)
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/flashbang
|
||||
materials = list(MAT_METAL=22000,MAT_GOLD=6000,MAT_SILVER=8000)
|
||||
construction_time = 100
|
||||
category = list("Exosuit Equipment")
|
||||
@@ -238,7 +238,7 @@
|
||||
id = "mech_missile_rack"
|
||||
build_type = MECHFAB
|
||||
req_tech = list("combat" = 6, "materials" = 6)
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/missile_rack
|
||||
materials = list(MAT_METAL=22000,MAT_GOLD=6000,MAT_SILVER=8000)
|
||||
construction_time = 100
|
||||
category = list("Exosuit Equipment")
|
||||
@@ -249,7 +249,7 @@
|
||||
id = "clusterbang_launcher"
|
||||
build_type = MECHFAB
|
||||
req_tech = list("combat"= 5, "materials" = 5, "syndicate" = 3)
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/flashbang/clusterbang
|
||||
materials = list(MAT_METAL=20000,MAT_GOLD=10000,MAT_URANIUM=10000)
|
||||
construction_time = 100
|
||||
category = list("Exosuit Equipment")
|
||||
@@ -282,7 +282,7 @@
|
||||
id = "mech_rcd"
|
||||
build_type = MECHFAB
|
||||
req_tech = list("materials" = 4, "bluespace" = 3, "magnets" = 4, "powerstorage"=4, "engineering" = 4)
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/tool/rcd
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/rcd
|
||||
materials = list(MAT_METAL=30000,MAT_GOLD=20000,MAT_PLASMA=25000,MAT_SILVER=20000)
|
||||
construction_time = 1200
|
||||
category = list("Exosuit Equipment")
|
||||
@@ -348,7 +348,7 @@
|
||||
id = "mech_diamond_drill"
|
||||
build_type = MECHFAB
|
||||
req_tech = list("materials" = 4, "engineering" = 3)
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/tool/drill/diamonddrill
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/drill/diamonddrill
|
||||
materials = list(MAT_METAL=10000,MAT_DIAMOND=6500)
|
||||
construction_time = 100
|
||||
category = list("Exosuit Equipment")
|
||||
|
||||
@@ -490,7 +490,7 @@
|
||||
name = "Exosuit Engineering Equipment (Hydraulic Clamp)"
|
||||
id = "mech_hydraulic_clamp"
|
||||
build_type = MECHFAB
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/hydraulic_clamp
|
||||
materials = list(MAT_METAL=10000)
|
||||
construction_time = 100
|
||||
category = list("Exosuit Equipment")
|
||||
@@ -499,7 +499,7 @@
|
||||
name = "Exosuit Engineering Equipment (Drill)"
|
||||
id = "mech_drill"
|
||||
build_type = MECHFAB
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/tool/drill
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/drill
|
||||
materials = list(MAT_METAL=10000)
|
||||
construction_time = 100
|
||||
category = list("Exosuit Equipment")
|
||||
@@ -508,7 +508,7 @@
|
||||
name = "Exosuit Engineering Equipement (Mining Scanner)"
|
||||
id = "mech_mscanner"
|
||||
build_type = MECHFAB
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/tool/mining_scanner
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/mining_scanner
|
||||
materials = list(MAT_METAL=5000,MAT_GLASS=2500)
|
||||
construction_time = 50
|
||||
category = list("Exosuit Equipment")
|
||||
@@ -517,7 +517,7 @@
|
||||
name = "Exosuit Engineering Equipment (Extinguisher)"
|
||||
id = "mech_extinguisher"
|
||||
build_type = MECHFAB
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/tool/extinguisher
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/extinguisher
|
||||
materials = list(MAT_METAL=10000)
|
||||
construction_time = 100
|
||||
category = list("Exosuit Equipment")
|
||||
@@ -526,7 +526,7 @@
|
||||
name = "Exosuit Engineering Equipment (Cable Layer)"
|
||||
id = "mech_cable_layer"
|
||||
build_type = MECHFAB
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/tool/cable_layer
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/cable_layer
|
||||
materials = list(MAT_METAL=10000)
|
||||
construction_time = 100
|
||||
category = list("Exosuit Equipment")
|
||||
@@ -535,7 +535,7 @@
|
||||
name = "Exosuit Medical Equipment (Mounted Sleeper)"
|
||||
id = "mech_sleeper"
|
||||
build_type = MECHFAB
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/tool/sleeper
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/sleeper
|
||||
materials = list(MAT_METAL=5000,MAT_GLASS=10000)
|
||||
construction_time = 100
|
||||
category = list("Exosuit Equipment")
|
||||
@@ -544,7 +544,7 @@
|
||||
name = "Exosuit Medical Equipment (Syringe Gun)"
|
||||
id = "mech_syringe_gun"
|
||||
build_type = MECHFAB
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/tool/syringe_gun
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/syringe_gun
|
||||
materials = list(MAT_METAL=3000,MAT_GLASS=2000)
|
||||
construction_time = 200
|
||||
category = list("Exosuit Equipment")
|
||||
@@ -580,7 +580,7 @@
|
||||
name = "H.O.N.K Mousetrap Mortar"
|
||||
id = "mech_mousetrap_mortar"
|
||||
build_type = MECHFAB
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/mousetrap_mortar
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/mousetrap_mortar
|
||||
materials = list(MAT_METAL=20000,MAT_BANANIUM=5000)
|
||||
construction_time = 300
|
||||
category = list("Exosuit Equipment")
|
||||
@@ -589,7 +589,7 @@
|
||||
name = "H.O.N.K Banana Mortar"
|
||||
id = "mech_banana_mortar"
|
||||
build_type = MECHFAB
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/banana_mortar
|
||||
materials = list(MAT_METAL=20000,MAT_BANANIUM=5000)
|
||||
construction_time = 300
|
||||
category = list("Exosuit Equipment")
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
extended
|
||||
extended
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
author: phil235
|
||||
delete-after: True
|
||||
changes:
|
||||
- rscadd: "Mechs no longer use object verbs and the exosuit interface tab. They now use action buttons. Mechs now have a cycle equipment action button to change weapon faster than by using the view stats window. Mechs get two special alerts when their battery or health is low. Mechs now properly consume energy when moving and having their lights on. Using a mech tool that takes time to act now shows a progress bar (e.g. mech drill)."
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 29 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
+5
-2
@@ -215,7 +215,6 @@
|
||||
#include "code\datums\helper_datums\construction_datum.dm"
|
||||
#include "code\datums\helper_datums\events.dm"
|
||||
#include "code\datums\helper_datums\getrev.dm"
|
||||
#include "code\datums\helper_datums\global_iterator.dm"
|
||||
#include "code\datums\helper_datums\icon_snapshot.dm"
|
||||
#include "code\datums\helper_datums\teleport.dm"
|
||||
#include "code\datums\helper_datums\topic_input.dm"
|
||||
@@ -501,7 +500,9 @@
|
||||
#include "code\game\mecha\mecha.dm"
|
||||
#include "code\game\mecha\mecha_construction_paths.dm"
|
||||
#include "code\game\mecha\mecha_control_console.dm"
|
||||
#include "code\game\mecha\mecha_defense.dm"
|
||||
#include "code\game\mecha\mecha_parts.dm"
|
||||
#include "code\game\mecha\mecha_topic.dm"
|
||||
#include "code\game\mecha\mecha_wreckage.dm"
|
||||
#include "code\game\mecha\combat\combat.dm"
|
||||
#include "code\game\mecha\combat\durand.dm"
|
||||
@@ -512,7 +513,9 @@
|
||||
#include "code\game\mecha\combat\reticence.dm"
|
||||
#include "code\game\mecha\equipment\mecha_equipment.dm"
|
||||
#include "code\game\mecha\equipment\tools\medical_tools.dm"
|
||||
#include "code\game\mecha\equipment\tools\tools.dm"
|
||||
#include "code\game\mecha\equipment\tools\mining_tools.dm"
|
||||
#include "code\game\mecha\equipment\tools\other_tools.dm"
|
||||
#include "code\game\mecha\equipment\tools\work_tools.dm"
|
||||
#include "code\game\mecha\equipment\weapons\weapons.dm"
|
||||
#include "code\game\mecha\medical\medical.dm"
|
||||
#include "code\game\mecha\medical\odysseus.dm"
|
||||
|
||||
Reference in New Issue
Block a user