mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-09 16:12:17 +00:00
Add clickable action buttons from /TG/, rework a lot of backend and other improvements.
This commit is contained in:
@@ -222,4 +222,8 @@
|
||||
|
||||
#undef AB_WEST_OFFSET
|
||||
#undef AB_NORTH_OFFSET
|
||||
#undef AB_MAX_COLUMNS
|
||||
#undef AB_MAX_COLUMNS
|
||||
|
||||
|
||||
/datum/action/innate/
|
||||
action_type = AB_INNATE
|
||||
@@ -12,8 +12,6 @@
|
||||
max_temperature = 30000
|
||||
infra_luminosity = 8
|
||||
force = 40
|
||||
var/defence = 0
|
||||
var/defence_deflect = 35
|
||||
wreckage = /obj/effect/decal/mecha_wreckage/durand
|
||||
|
||||
max_hull_equip = 2
|
||||
@@ -22,6 +20,8 @@
|
||||
max_universal_equip = 1
|
||||
max_special_equip = 1
|
||||
|
||||
defence_mode_possible = 1
|
||||
|
||||
/*
|
||||
/obj/mecha/combat/durand/New()
|
||||
..()
|
||||
@@ -31,40 +31,9 @@
|
||||
return
|
||||
*/
|
||||
|
||||
/obj/mecha/combat/durand/relaymove(mob/user,direction)
|
||||
if(defence)
|
||||
if(world.time - last_message > 20)
|
||||
src.occupant_message("<font color='red'>Unable to move while in defence mode</font>")
|
||||
last_message = world.time
|
||||
return 0
|
||||
. = ..()
|
||||
return
|
||||
|
||||
|
||||
/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(usr!=src.occupant)
|
||||
return
|
||||
playsound(src, 'sound/mecha/duranddefencemode.ogg', 50, 1)
|
||||
defence = !defence
|
||||
if(defence)
|
||||
deflect_chance = defence_deflect
|
||||
src.occupant_message("<font color='blue'>You enable [src] defence mode.</font>")
|
||||
else
|
||||
deflect_chance = initial(deflect_chance)
|
||||
src.occupant_message("<font color='red'>You disable [src] defence mode.</font>")
|
||||
src.log_message("Toggled defence mode.")
|
||||
return
|
||||
|
||||
|
||||
/obj/mecha/combat/durand/get_stats_part()
|
||||
var/output = ..()
|
||||
output += "<b>Defence mode: [defence?"on":"off"]</b>"
|
||||
return output
|
||||
|
||||
//This is for the Mech stats / Menu system. To be moved later on.
|
||||
/obj/mecha/combat/durand/get_commands()
|
||||
var/output = {"<div class='wr'>
|
||||
<div class='header'>Special</div>
|
||||
@@ -76,8 +45,20 @@
|
||||
output += ..()
|
||||
return output
|
||||
|
||||
|
||||
//Not needed anymore but left for reference.
|
||||
/*
|
||||
/obj/mecha/combat/durand/get_stats_part()
|
||||
var/output = ..()
|
||||
output += "<b>Defence mode: [defence?"on":"off"]</b>"
|
||||
return output
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
/obj/mecha/combat/durand/Topic(href, href_list)
|
||||
..()
|
||||
if (href_list["toggle_defence_mode"])
|
||||
src.defence_mode()
|
||||
return
|
||||
return
|
||||
*/
|
||||
@@ -1,3 +1,116 @@
|
||||
|
||||
/obj/mecha/combat/gorilla
|
||||
name = "Gorilla"
|
||||
desc = "<b>Blitzkrieg!</b>" //stop using all caps in item descs i will fight you. its redundant with the bold.
|
||||
icon = 'icons/mecha/mecha64x64.dmi'
|
||||
icon_state = "pzrmech"
|
||||
initial_icon = "pzrmech"
|
||||
pixel_x = -16
|
||||
step_in = 10
|
||||
health = 5000
|
||||
maxhealth = 5000
|
||||
opacity = 0 // Because there's big tall legs to look through. Also it looks fucky if this is set to 1.
|
||||
deflect_chance = 50
|
||||
damage_absorption = list("brute"=0.1,"fire"=0.8,"bullet"=0.1,"laser"=0.6,"energy"=0.7,"bomb"=0.7) //values show how much damage will pass through, not how much will be absorbed.
|
||||
max_temperature = 35000 //Just a bit better than the Durand.
|
||||
infra_luminosity = 3
|
||||
wreckage = /obj/effect/decal/mecha_wreckage/gorilla
|
||||
add_req_access = 0
|
||||
internal_damage_threshold = 25
|
||||
force = 60
|
||||
max_equip = 5
|
||||
//This will (Should) never be in the hands of players. If it is, the one who inflicted this monster upon the server can edit these vars to not be insane.
|
||||
max_hull_equip = 5
|
||||
max_weapon_equip = 5
|
||||
max_utility_equip = 5
|
||||
max_universal_equip = 5
|
||||
max_special_equip = 2
|
||||
|
||||
smoke_possible = 1
|
||||
zoom_possible = 1
|
||||
thrusters_possible = 1
|
||||
|
||||
/obj/mecha/combat/gorilla/Initialize()
|
||||
..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/tesla_energy_relay(src) // This thing basically cannot function without an external power supply.
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/cannon(src)
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/cannon/weak(src) //Saves energy, I suppose. Anti-infantry.
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive(src)
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg(src)
|
||||
ME.attach(src)
|
||||
return
|
||||
|
||||
/obj/mecha/combat/gorilla/mechstep(direction)
|
||||
var/result = step(src,direction)
|
||||
playsound(src,"mechstep",40,1)
|
||||
return result
|
||||
|
||||
/obj/mecha/combat/gorilla/mechturn(direction)
|
||||
dir = direction
|
||||
playsound(src,"mechstep",40,1)
|
||||
|
||||
|
||||
/obj/mecha/combat/gorilla/relaymove(mob/user,direction)
|
||||
if(user != src.occupant)
|
||||
user.loc = get_turf(src)
|
||||
to_chat(user, "You climb out from [src]")
|
||||
return 0
|
||||
if(!can_move)
|
||||
return 0
|
||||
if(zoom)
|
||||
if(world.time - last_message > 20)
|
||||
src.occupant_message("Unable to move while in zoom mode.")
|
||||
last_message = world.time
|
||||
return 0
|
||||
if(connected_port)
|
||||
if(world.time - last_message > 20)
|
||||
src.occupant_message("Unable to move while connected to the air system port")
|
||||
last_message = world.time
|
||||
return 0
|
||||
if(state || !has_charge(step_energy_drain))
|
||||
return 0
|
||||
var/tmp_step_in = step_in
|
||||
var/tmp_step_energy_drain = step_energy_drain
|
||||
var/move_result = 0
|
||||
if(internal_damage&MECHA_INT_CONTROL_LOST)
|
||||
move_result = mechsteprand()
|
||||
else if(src.dir!=direction)
|
||||
move_result = mechturn(direction)
|
||||
else
|
||||
move_result = mechstep(direction)
|
||||
if(move_result)
|
||||
if(istype(src.loc, /turf/space))
|
||||
if(!src.check_for_support())
|
||||
src.pr_inertial_movement.start(list(src,direction))
|
||||
can_move = 0
|
||||
spawn(tmp_step_in) can_move = 1
|
||||
use_power(tmp_step_energy_drain)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/obj/mecha/combat/gorilla/get_stats_part()
|
||||
var/output = ..()
|
||||
output += {"<b>Smoke:</b> [smoke_reserve]"}
|
||||
return output
|
||||
|
||||
|
||||
/obj/mecha/combat/gorilla/get_commands()
|
||||
var/output = {"<div class='wr'>
|
||||
<div class='header'>Special</div>
|
||||
<div class='links'>
|
||||
<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
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/cannon
|
||||
name = "8.8cm KwK 47"
|
||||
desc = "<i>Precision German engineering!</i>" // Why would you ever take this off the mech, anyway?
|
||||
@@ -54,167 +167,3 @@
|
||||
plane = MOB_PLANE
|
||||
pixel_x = -16
|
||||
anchored = 1 // It's fucking huge. You aren't moving it.
|
||||
|
||||
/obj/mecha/combat/gorilla
|
||||
name = "Gorilla"
|
||||
desc = "<b>Blitzkrieg!</b>" //stop using all caps in item descs i will fight you. its redundant with the bold.
|
||||
icon = 'icons/mecha/mecha64x64.dmi'
|
||||
icon_state = "pzrmech"
|
||||
initial_icon = "pzrmech"
|
||||
pixel_x = -16
|
||||
step_in = 10
|
||||
health = 5000
|
||||
maxhealth = 5000
|
||||
opacity = 0 // Because there's big tall legs to look through. Also it looks fucky if this is set to 1.
|
||||
deflect_chance = 50
|
||||
damage_absorption = list("brute"=0.1,"fire"=0.8,"bullet"=0.1,"laser"=0.6,"energy"=0.7,"bomb"=0.7) //values show how much damage will pass through, not how much will be absorbed.
|
||||
max_temperature = 35000 //Just a bit better than the Durand.
|
||||
infra_luminosity = 3
|
||||
var/zoom = 0
|
||||
var/smoke = 5
|
||||
var/smoke_ready = 1
|
||||
var/smoke_cooldown = 100
|
||||
var/datum/effect/effect/system/smoke_spread/smoke_system = new
|
||||
wreckage = /obj/effect/decal/mecha_wreckage/gorilla
|
||||
add_req_access = 0
|
||||
internal_damage_threshold = 25
|
||||
force = 60
|
||||
max_equip = 5
|
||||
//This will (Should) never be in the hands of players. If it is, the one who inflicted this monster upon the server can edit these vars to not be insane.
|
||||
max_hull_equip = 5
|
||||
max_weapon_equip = 5
|
||||
max_utility_equip = 5
|
||||
max_universal_equip = 5
|
||||
max_special_equip = 2
|
||||
|
||||
/obj/mecha/combat/gorilla/Initialize()
|
||||
..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/tesla_energy_relay(src) // This thing basically cannot function without an external power supply.
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/cannon(src)
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/cannon/weak(src) //Saves energy, I suppose. Anti-infantry.
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive(src)
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg(src)
|
||||
ME.attach(src)
|
||||
src.smoke_system.set_up(3, 0, src)
|
||||
src.smoke_system.attach(src)
|
||||
return
|
||||
|
||||
/obj/mecha/combat/gorilla/mechstep(direction)
|
||||
var/result = step(src,direction)
|
||||
playsound(src,"mechstep",40,1)
|
||||
return result
|
||||
|
||||
/obj/mecha/combat/gorilla/mechturn(direction)
|
||||
dir = direction
|
||||
playsound(src,"mechstep",40,1)
|
||||
|
||||
|
||||
/obj/mecha/combat/gorilla/relaymove(mob/user,direction)
|
||||
if(user != src.occupant)
|
||||
user.loc = get_turf(src)
|
||||
to_chat(user, "You climb out from [src]")
|
||||
return 0
|
||||
if(!can_move)
|
||||
return 0
|
||||
if(zoom)
|
||||
if(world.time - last_message > 20)
|
||||
src.occupant_message("Unable to move while in zoom mode.")
|
||||
last_message = world.time
|
||||
return 0
|
||||
if(connected_port)
|
||||
if(world.time - last_message > 20)
|
||||
src.occupant_message("Unable to move while connected to the air system port")
|
||||
last_message = world.time
|
||||
return 0
|
||||
if(state || !has_charge(step_energy_drain))
|
||||
return 0
|
||||
var/tmp_step_in = step_in
|
||||
var/tmp_step_energy_drain = step_energy_drain
|
||||
var/move_result = 0
|
||||
if(internal_damage&MECHA_INT_CONTROL_LOST)
|
||||
move_result = mechsteprand()
|
||||
else if(src.dir!=direction)
|
||||
move_result = mechturn(direction)
|
||||
else
|
||||
move_result = mechstep(direction)
|
||||
if(move_result)
|
||||
if(istype(src.loc, /turf/space))
|
||||
if(!src.check_for_support())
|
||||
src.pr_inertial_movement.start(list(src,direction))
|
||||
can_move = 0
|
||||
spawn(tmp_step_in) can_move = 1
|
||||
use_power(tmp_step_energy_drain)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/mecha/combat/gorilla/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
|
||||
|
||||
/obj/mecha/combat/gorilla/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.set_viewsize(12)
|
||||
playsound(src, 'sound/mecha/imag_enh.ogg',50)
|
||||
else
|
||||
src.occupant.set_viewsize() // Reset to default
|
||||
return
|
||||
|
||||
|
||||
/obj/mecha/combat/gorilla/go_out()
|
||||
if(src.occupant && src.occupant.client)
|
||||
src.occupant.client.view = world.view
|
||||
src.zoom = 0
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
/obj/mecha/combat/gorilla/get_stats_part()
|
||||
var/output = ..()
|
||||
output += {"<b>Smoke:</b> [smoke]"}
|
||||
return output
|
||||
|
||||
|
||||
/obj/mecha/combat/gorilla/get_commands()
|
||||
var/output = {"<div class='wr'>
|
||||
<div class='header'>Special</div>
|
||||
<div class='links'>
|
||||
<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
|
||||
|
||||
/obj/mecha/combat/gorilla/Topic(href, href_list)
|
||||
..()
|
||||
if (href_list["smoke"])
|
||||
src.smoke()
|
||||
if (href_list["toggle_zoom"])
|
||||
src.zoom()
|
||||
return
|
||||
@@ -11,8 +11,6 @@
|
||||
damage_absorption = list("brute"=0.75,"fire"=1,"bullet"=0.8,"laser"=0.7,"energy"=0.85,"bomb"=1)
|
||||
max_temperature = 25000
|
||||
infra_luminosity = 6
|
||||
var/overload = 0
|
||||
var/overload_coeff = 2
|
||||
wreckage = /obj/effect/decal/mecha_wreckage/gygax
|
||||
internal_damage_threshold = 35
|
||||
max_equip = 3
|
||||
@@ -23,6 +21,21 @@
|
||||
max_universal_equip = 1
|
||||
max_special_equip = 1
|
||||
|
||||
overload_possible = 1
|
||||
|
||||
//Not quite sure how to move those yet.
|
||||
/obj/mecha/combat/gygax/get_commands()
|
||||
var/output = {"<div class='wr'>
|
||||
<div class='header'>Special</div>
|
||||
<div class='links'>
|
||||
<a href='?src=\ref[src];toggle_leg_overload=1'>Toggle leg actuators overload</a>
|
||||
</div>
|
||||
</div>
|
||||
"}
|
||||
output += ..()
|
||||
return output
|
||||
|
||||
|
||||
/obj/mecha/combat/gygax/dark
|
||||
desc = "A lightweight exosuit used by Heavy Asset Protection. A significantly upgraded Gygax security mech."
|
||||
name = "Dark Gygax"
|
||||
@@ -66,62 +79,6 @@
|
||||
cell.charge = 30000
|
||||
cell.maxcharge = 30000
|
||||
|
||||
|
||||
/obj/mecha/combat/gygax/verb/overload()
|
||||
set category = "Exosuit Interface"
|
||||
set name = "Toggle leg actuators overload"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
if(usr!=src.occupant)
|
||||
return
|
||||
if(overload)
|
||||
overload = 0
|
||||
step_in = initial(step_in)
|
||||
step_energy_drain = initial(step_energy_drain)
|
||||
src.occupant_message("<font color='blue'>You disable leg actuators overload.</font>")
|
||||
else
|
||||
overload = 1
|
||||
step_in = min(1, round(step_in/2))
|
||||
step_energy_drain = step_energy_drain*overload_coeff
|
||||
src.occupant_message("<font color='red'>You enable leg actuators overload.</font>")
|
||||
src.log_message("Toggled leg actuators overload.")
|
||||
playsound(src, 'sound/mecha/mechanical_toggle.ogg', 50, 1)
|
||||
return
|
||||
|
||||
/obj/mecha/combat/gygax/dyndomove(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("<font color='red'>Leg actuators damage threshold exceded. Disabling overload.</font>")
|
||||
return
|
||||
|
||||
|
||||
/obj/mecha/combat/gygax/get_stats_part()
|
||||
var/output = ..()
|
||||
output += "<b>Leg actuators overload: [overload?"on":"off"]</b>"
|
||||
return output
|
||||
|
||||
/obj/mecha/combat/gygax/get_commands()
|
||||
var/output = {"<div class='wr'>
|
||||
<div class='header'>Special</div>
|
||||
<div class='links'>
|
||||
<a href='?src=\ref[src];toggle_leg_overload=1'>Toggle leg actuators overload</a>
|
||||
</div>
|
||||
</div>
|
||||
"}
|
||||
output += ..()
|
||||
return output
|
||||
|
||||
/obj/mecha/combat/gygax/Topic(href, href_list)
|
||||
..()
|
||||
if (href_list["toggle_leg_overload"])
|
||||
src.overload()
|
||||
return
|
||||
|
||||
/obj/mecha/combat/gygax/serenity
|
||||
desc = "A lightweight exosuit made from a modified Gygax chassis combined with proprietary VeyMed medical tech. It's faster and sturdier than most medical mechs, but much of the armor plating has been stripped out, leaving it more vulnerable than a regular Gygax."
|
||||
name = "Serenity"
|
||||
|
||||
@@ -11,12 +11,6 @@
|
||||
damage_absorption = list("brute"=0.5,"fire"=0.7,"bullet"=0.45,"laser"=0.6,"energy"=0.7,"bomb"=0.7)
|
||||
max_temperature = 60000
|
||||
infra_luminosity = 3
|
||||
var/zoom = 0
|
||||
var/thrusters = 0
|
||||
var/smoke = 5
|
||||
var/smoke_ready = 1
|
||||
var/smoke_cooldown = 100
|
||||
var/datum/effect/effect/system/smoke_spread/smoke_system = new
|
||||
operation_req_access = list(access_cent_specops)
|
||||
wreckage = /obj/effect/decal/mecha_wreckage/marauder
|
||||
add_req_access = 0
|
||||
@@ -31,6 +25,10 @@
|
||||
max_universal_equip = 1
|
||||
max_special_equip = 1
|
||||
|
||||
smoke_possible = 1
|
||||
zoom_possible = 1
|
||||
thrusters_possible = 1
|
||||
|
||||
/obj/mecha/combat/marauder/seraph
|
||||
desc = "Heavy-duty, command-type exosuit. This is a custom model, utilized only by high-ranking military personnel."
|
||||
name = "Seraph"
|
||||
@@ -45,7 +43,7 @@
|
||||
force = 55
|
||||
max_equip = 5
|
||||
|
||||
|
||||
//Note that is the Mauler
|
||||
/obj/mecha/combat/marauder/mauler
|
||||
desc = "Heavy-duty, combat exosuit, developed off of the existing Marauder model."
|
||||
name = "Mauler"
|
||||
@@ -55,6 +53,7 @@
|
||||
wreckage = /obj/effect/decal/mecha_wreckage/mauler
|
||||
mech_faction = MECH_FACTION_SYNDI
|
||||
|
||||
//Note that is the default Marauder
|
||||
/obj/mecha/combat/marauder/Initialize()
|
||||
..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/energy/pulse
|
||||
@@ -65,10 +64,9 @@
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster(src)
|
||||
ME.attach(src)
|
||||
src.smoke_system.set_up(3, 0, src)
|
||||
src.smoke_system.attach(src)
|
||||
return
|
||||
|
||||
//Note that this is the seraph.
|
||||
/obj/mecha/combat/marauder/seraph/Initialize()
|
||||
..()//Let it equip whatever is needed.
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME
|
||||
@@ -88,10 +86,8 @@
|
||||
ME.attach(src)
|
||||
return
|
||||
|
||||
/obj/mecha/combat/marauder/Destroy()
|
||||
qdel(smoke_system)
|
||||
..()
|
||||
|
||||
//I'll break this down later
|
||||
/obj/mecha/combat/marauder/relaymove(mob/user,direction)
|
||||
if(user != src.occupant) //While not "realistic", this piece is player friendly.
|
||||
user.loc = get_turf(src)
|
||||
@@ -136,74 +132,7 @@
|
||||
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.</font>")
|
||||
return
|
||||
|
||||
|
||||
/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
|
||||
|
||||
//TODO replace this with zoom code that doesn't increase peripherial vision
|
||||
/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.set_viewsize(12)
|
||||
src.occupant << sound('sound/mecha/imag_enh.ogg',volume=50)
|
||||
else
|
||||
src.occupant.set_viewsize() // Reset to default
|
||||
return
|
||||
|
||||
|
||||
/obj/mecha/combat/marauder/go_out()
|
||||
if(src.occupant && src.occupant.client)
|
||||
src.occupant.client.view = world.view
|
||||
src.zoom = 0
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
/obj/mecha/combat/marauder/get_stats_part()
|
||||
var/output = ..()
|
||||
output += {"<b>Smoke:</b> [smoke]
|
||||
<br>
|
||||
<b>Thrusters:</b> [thrusters?"on":"off"]
|
||||
"}
|
||||
return output
|
||||
|
||||
|
||||
//To be kill ltr
|
||||
/obj/mecha/combat/marauder/get_commands()
|
||||
var/output = {"<div class='wr'>
|
||||
<div class='header'>Special</div>
|
||||
@@ -216,13 +145,3 @@
|
||||
"}
|
||||
output += ..()
|
||||
return output
|
||||
|
||||
/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
|
||||
@@ -17,9 +17,6 @@
|
||||
//operation_req_access = list()
|
||||
internal_damage_threshold = 25
|
||||
force = 15
|
||||
var/phasing = 0
|
||||
var/can_phase = TRUE
|
||||
var/phasing_energy_drain = 200
|
||||
max_equip = 4
|
||||
|
||||
max_hull_equip = 3
|
||||
@@ -28,6 +25,9 @@
|
||||
max_universal_equip = 3
|
||||
max_special_equip = 4
|
||||
|
||||
phasing_possible = 1
|
||||
switch_dmg_type_possible = 1
|
||||
|
||||
/obj/mecha/combat/phazon/equipped/Initialize()
|
||||
..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/tool/rcd
|
||||
@@ -36,6 +36,7 @@
|
||||
ME.attach(src)
|
||||
return
|
||||
|
||||
/* Leaving this until we are really sure we don't need it for reference.
|
||||
/obj/mecha/combat/phazon/Bump(var/atom/obstacle)
|
||||
if(phasing && get_charge()>=phasing_energy_drain)
|
||||
spawn()
|
||||
@@ -49,35 +50,8 @@
|
||||
else
|
||||
. = ..()
|
||||
return
|
||||
*/
|
||||
|
||||
/obj/mecha/combat/phazon/click_action(atom/target,mob/user)
|
||||
if(phasing)
|
||||
src.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 = "Change melee damage type"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
if(usr!=src.occupant)
|
||||
return
|
||||
|
||||
query_damtype()
|
||||
|
||||
/obj/mecha/combat/phazon/proc/query_damtype()
|
||||
var/new_damtype = alert(src.occupant,"Melee Damage Type",null,"Brute","Fire","Toxic")
|
||||
switch(new_damtype)
|
||||
if("Brute")
|
||||
damtype = "brute"
|
||||
if("Fire")
|
||||
damtype = "fire"
|
||||
if("Toxic")
|
||||
damtype = "tox"
|
||||
src.occupant_message("Melee damage type switched to [new_damtype ]")
|
||||
return
|
||||
|
||||
/obj/mecha/combat/phazon/get_commands()
|
||||
var/output = {"<div class='wr'>
|
||||
@@ -91,15 +65,7 @@
|
||||
output += ..()
|
||||
return output
|
||||
|
||||
/obj/mecha/combat/phazon/Topic(href, href_list)
|
||||
..()
|
||||
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
|
||||
|
||||
|
||||
/obj/mecha/combat/phazon/janus
|
||||
name = "Phazon Prototype Janus Class"
|
||||
@@ -121,7 +87,6 @@
|
||||
wreckage = /obj/effect/decal/mecha_wreckage/janus
|
||||
internal_damage_threshold = 25
|
||||
force = 20
|
||||
phasing = FALSE
|
||||
phasing_energy_drain = 300
|
||||
|
||||
max_hull_equip = 2
|
||||
@@ -130,6 +95,9 @@
|
||||
max_universal_equip = 2
|
||||
max_special_equip = 2
|
||||
|
||||
phasing_possible = 1
|
||||
switch_dmg_type_possible = 1
|
||||
|
||||
/obj/mecha/combat/phazon/janus/take_damage(amount, type="brute")
|
||||
..()
|
||||
if(phasing)
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
/obj/item/mecha_parts/mecha_equipment/speedboost/attach(obj/mecha/M as obj)
|
||||
..()
|
||||
if(enable_special)
|
||||
chassis.step_in = (chassis.step_in-2) // Make the ripley as fast as a durand
|
||||
chassis.step_in = 3 // As fast as a gygax without overload. Slower than Ody.
|
||||
else
|
||||
chassis.step_in = (chassis.step_in+1) // Improper parts slow the mech down
|
||||
chassis.step_in = 6 // Improper parts slow the mech down
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/speedboost/detach()
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
var/obj/item/mecha_parts/mecha_equipment/selected
|
||||
var/max_equip = 2
|
||||
var/datum/events/events
|
||||
|
||||
//mechaequipt2 stuffs
|
||||
var/list/hull_equipment = new
|
||||
var/list/weapon_equipment = new
|
||||
@@ -91,6 +92,7 @@
|
||||
var/max_utility_equip = 2
|
||||
var/max_universal_equip = 2
|
||||
var/max_special_equip = 1
|
||||
|
||||
//Working exosuit vars
|
||||
var/list/cargo = list()
|
||||
var/cargo_capacity = 3
|
||||
@@ -100,8 +102,62 @@
|
||||
var/static/image/radial_image_lighttoggle = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_light")
|
||||
var/static/image/radial_image_statpanel = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_examine2")
|
||||
|
||||
<<<<<<< HEAD
|
||||
var/datum/mini_hud/mech/minihud //VOREStation Edit
|
||||
var/strafing = 0
|
||||
=======
|
||||
|
||||
//Mech actions
|
||||
|
||||
var/strafing = 0 //Are we strafing or not?
|
||||
|
||||
var/defence_mode_possible = 0 //Can we even use defence mode? This is used to assign it to mechs and check for verbs.
|
||||
var/defence_mode = 0 //Are we in defence mode
|
||||
var/defence_deflect = 35 //How much it deflect
|
||||
|
||||
var/overload_possible = 0 //Same as above. Don't forget to GRANT the verb&actions if you want everything to work proper.
|
||||
var/overload = 0 //Are our legs overloaded
|
||||
var/overload_coeff = 1 //How much extra energy you use when use the L E G
|
||||
|
||||
var/zoom = 0
|
||||
var/zoom_possible = 0
|
||||
|
||||
var/thrusters = 0
|
||||
var/thrusters_possible = 0
|
||||
|
||||
var/phasing = 0 //Are we currently phasing
|
||||
var/phasing_possible = 0 //This is to allow phasing.
|
||||
var/can_phase = TRUE //This is an internal check during the relevant procs.
|
||||
var/phasing_energy_drain = 200
|
||||
|
||||
var/switch_dmg_type_possible = 0 //Can you switch damage type? It is mostly for the Phazon and its children.
|
||||
|
||||
var/smoke_possible = 0
|
||||
var/smoke_reserve = 5 //How many shots you have. Might make a reload later on. MIGHT.
|
||||
var/smoke_ready = 1 //This is a check for the whether or not the cooldown is ongoing.
|
||||
var/smoke_cooldown = 100 //How long you have between uses.
|
||||
var/datum/effect/effect/system/smoke_spread/smoke_system = new
|
||||
|
||||
////All of those are for the HUD buttons in the top left. See Grant and Remove procs in mecha_actions.
|
||||
|
||||
var/datum/action/innate/mecha/mech_eject/eject_action = new
|
||||
var/datum/action/innate/mecha/mech_toggle_internals/internals_action = new
|
||||
var/datum/action/innate/mecha/mech_toggle_lights/lights_action = new
|
||||
var/datum/action/innate/mecha/mech_view_stats/stats_action = new
|
||||
var/datum/action/innate/mecha/strafe/strafing_action = new
|
||||
|
||||
var/datum/action/innate/mecha/mech_defence_mode/defence_action = new
|
||||
var/datum/action/innate/mecha/mech_overload_mode/overload_action = new
|
||||
var/datum/action/innate/mecha/mech_smoke/smoke_action = new
|
||||
var/datum/action/innate/mecha/mech_zoom/zoom_action = new
|
||||
var/datum/action/innate/mecha/mech_toggle_thrusters/thrusters_action = new
|
||||
var/datum/action/innate/mecha/mech_cycle_equip/cycle_action = new
|
||||
var/datum/action/innate/mecha/mech_switch_damtype/switch_damtype_action = new
|
||||
var/datum/action/innate/mecha/mech_toggle_phasing/phasing_action = new
|
||||
|
||||
|
||||
|
||||
>>>>>>> ce9ceb4... Add clickable action buttons from /TG/, rework a lot of backend and other improvements. (#7315)
|
||||
|
||||
/obj/mecha/drain_power(var/drain_check)
|
||||
|
||||
@@ -123,8 +179,14 @@
|
||||
if(!add_airtank()) //we check this here in case mecha does not have an internal tank available by default - WIP
|
||||
removeVerb(/obj/mecha/verb/connect_to_port)
|
||||
removeVerb(/obj/mecha/verb/toggle_internal_tank)
|
||||
|
||||
spark_system.set_up(2, 0, src)
|
||||
spark_system.attach(src)
|
||||
|
||||
if(smoke_possible)//I am pretty sure that's needed here.
|
||||
src.smoke_system.set_up(3, 0, src)
|
||||
src.smoke_system.attach(src)
|
||||
|
||||
add_cell()
|
||||
add_iterators()
|
||||
removeVerb(/obj/mecha/verb/disconnect_from_port)
|
||||
@@ -192,6 +254,9 @@
|
||||
cell = null
|
||||
internal_tank = null
|
||||
|
||||
if(smoke_possible) //Just making sure nothing is running.
|
||||
qdel(smoke_system)
|
||||
|
||||
QDEL_NULL(pr_int_temp_processor)
|
||||
QDEL_NULL(pr_inertial_movement)
|
||||
QDEL_NULL(pr_give_air)
|
||||
@@ -283,11 +348,11 @@
|
||||
if(65 to 85)
|
||||
. += "It's slightly damaged."
|
||||
if(45 to 65)
|
||||
. += "It's badly damaged."
|
||||
. += "<span class='notice'>It's badly damaged.</span>"
|
||||
if(25 to 45)
|
||||
. += "It's heavily damaged."
|
||||
. += "<span class='warning'>It's heavily damaged.</span>"
|
||||
else
|
||||
. += "It's falling apart."
|
||||
. += "<span class='warning'><b> It's falling apart.</b> </span>"
|
||||
if(equipment?.len)
|
||||
. += "It's equipped with:"
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/ME in equipment)
|
||||
@@ -319,6 +384,7 @@
|
||||
"Toggle Light" = radial_image_lighttoggle,
|
||||
"View Stats" = radial_image_statpanel
|
||||
)
|
||||
|
||||
var/choice = show_radial_menu(user, src, choices, custom_check = CALLBACK(src, .proc/check_occupant_radial, user), require_near = TRUE, tooltips = TRUE)
|
||||
if(!check_occupant_radial(user))
|
||||
return
|
||||
@@ -380,6 +446,11 @@
|
||||
if(state)
|
||||
occupant_message("<font color='red'>Maintenance protocols in effect</font>")
|
||||
return
|
||||
|
||||
if(phasing)//Phazon and other mechs with phasing.
|
||||
src.occupant_message("Unable to interact with objects while phasing")//Haha dumbass.
|
||||
return
|
||||
|
||||
if(!get_charge()) return
|
||||
if(src == target) return
|
||||
var/dir_to_target = get_dir(src,target)
|
||||
@@ -463,6 +534,13 @@
|
||||
if(state)
|
||||
occupant_message("<span class='warning'>Maintenance protocols in effect</span>")
|
||||
return
|
||||
/*
|
||||
if(zoom)
|
||||
if(world.time - last_message > 20)
|
||||
src.occupant_message("Unable to move while in zoom mode.")
|
||||
last_message = world.time
|
||||
return 0
|
||||
*/
|
||||
return domove(direction)
|
||||
|
||||
/obj/mecha/proc/can_ztravel()
|
||||
@@ -482,6 +560,32 @@
|
||||
if(!has_charge(step_energy_drain))
|
||||
return 0
|
||||
|
||||
//Can we even move, below is if yes.
|
||||
|
||||
if(defence_mode)//Check if we are currently locked down
|
||||
if(world.time - last_message > 20)
|
||||
src.occupant_message("<font color='red'>Unable to move while in defence mode</font>")
|
||||
last_message = world.time
|
||||
return 0
|
||||
|
||||
if(zoom)//:eyes:
|
||||
if(world.time - last_message > 20)
|
||||
src.occupant_message("Unable to move while in zoom mode.")
|
||||
last_message = world.time
|
||||
return 0
|
||||
|
||||
if(!thrusters && src.pr_inertial_movement.active()) //I think this mean 'if you try to move in space without thruster, u no move'
|
||||
return 0
|
||||
|
||||
if(overload)//Check if you have leg 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("<font color='red'>Leg actuators damage threshold exceded. Disabling overload.</font>")
|
||||
|
||||
|
||||
var/move_result = 0
|
||||
|
||||
if(hasInternalDamage(MECHA_INT_CONTROL_LOST))
|
||||
@@ -572,21 +676,35 @@
|
||||
|
||||
/obj/mecha/Bump(var/atom/obstacle)
|
||||
// src.inertia_dir = null
|
||||
if(istype(obstacle, /obj))
|
||||
if(istype(obstacle, /mob))//First we check if it is a mob. Mechs mostly shouln't go through them, even while phasing.
|
||||
var/mob/M = obstacle
|
||||
M.Move(get_step(obstacle,src.dir))
|
||||
else if(istype(obstacle, /obj))//Then we check for regular obstacles.
|
||||
var/obj/O = obstacle
|
||||
if(istype(O, /obj/effect/portal)) //derpfix
|
||||
src.anchored = 0
|
||||
|
||||
if(phasing && get_charge()>=phasing_energy_drain)//Phazon check. This could use an improvement elsewhere.
|
||||
spawn()
|
||||
if(can_phase)
|
||||
can_phase = FALSE
|
||||
flick("[initial_icon]-phase", src)
|
||||
src.loc = get_step(src,src.dir)
|
||||
src.use_power(phasing_energy_drain)
|
||||
sleep(step_in*3)
|
||||
can_phase = TRUE
|
||||
occupant_message("Phazed.")
|
||||
. = ..(obstacle)
|
||||
return
|
||||
if(istype(O, /obj/effect/portal)) //derpfix
|
||||
src.anchored = 0 //I have no idea what this really fix.
|
||||
O.Crossed(src)
|
||||
spawn(0)//countering portal teleport spawn(0), hurr
|
||||
src.anchored = 1
|
||||
else if(!O.anchored)
|
||||
step(obstacle,src.dir)
|
||||
else //I have no idea why I disabled this
|
||||
else if(O.anchored)
|
||||
obstacle.Bumped(src)
|
||||
else if(istype(obstacle, /mob))
|
||||
var/mob/M = obstacle
|
||||
M.Move(get_step(obstacle,src.dir))
|
||||
else
|
||||
else
|
||||
step(obstacle,src.dir)
|
||||
|
||||
else//No idea when this triggers, so i won't touch it.
|
||||
. = ..(obstacle)
|
||||
return
|
||||
|
||||
@@ -1229,6 +1347,9 @@
|
||||
set category = "Exosuit Interface"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
lights()
|
||||
|
||||
/obj/mecha/verb/lights()
|
||||
if(usr!=occupant) return
|
||||
lights = !lights
|
||||
if(lights) set_light(light_range + lights_power)
|
||||
@@ -1244,18 +1365,25 @@
|
||||
set category = "Exosuit Interface"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
internal_tank()
|
||||
|
||||
/obj/mecha/proc/internal_tank()
|
||||
if(usr!=src.occupant)
|
||||
return
|
||||
use_internal_tank = !use_internal_tank
|
||||
src.occupant_message("Now taking air from [use_internal_tank?"internal airtank":"environment"].")
|
||||
src.log_message("Now taking air from [use_internal_tank?"internal airtank":"environment"].")
|
||||
playsound(src, 'sound/mecha/gasdisconnected.ogg', 30, 1)
|
||||
return
|
||||
|
||||
|
||||
/obj/mecha/verb/toggle_strafing()
|
||||
set name = "Toggle strafing"
|
||||
set category = "Exosuit Interface"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
|
||||
/obj/mecha/proc/strafing()
|
||||
if(usr!=src.occupant)
|
||||
return
|
||||
strafing = !strafing
|
||||
@@ -1324,6 +1452,8 @@
|
||||
if(enter_after(40,usr))
|
||||
if(!src.occupant)
|
||||
moved_inside(usr)
|
||||
if(ishuman(occupant)) //Aeiou
|
||||
GrantActions(occupant, 1)
|
||||
else if(src.occupant!=usr)
|
||||
to_chat(usr, "[src.occupant] was faster. Try better next time, loser.")
|
||||
else
|
||||
@@ -1345,8 +1475,31 @@
|
||||
src.verbs += /obj/mecha/verb/eject
|
||||
src.log_append_to_last("[H] moved in as pilot.")
|
||||
src.icon_state = src.reset_icon()
|
||||
<<<<<<< HEAD
|
||||
if(occupant.hud_used)
|
||||
minihud = new (occupant.hud_used, src)
|
||||
=======
|
||||
|
||||
//This part removes all the verbs if you don't have them the _possible on your mech. This is a little clunky, but it lets you just add that to any mech.
|
||||
//And it's not like this 10yo code wasn't clunky before.
|
||||
|
||||
if(!smoke_possible) //Can't use smoke? No verb for you.
|
||||
verbs -= /obj/mecha/verb/toggle_smoke
|
||||
if(!thrusters_possible) //Can't use thrusters? No verb for you.
|
||||
verbs -= /obj/mecha/verb/toggle_thrusters
|
||||
if(!defence_mode_possible) //Do i need to explain everything?
|
||||
verbs -= /obj/mecha/verb/toggle_defence_mode
|
||||
if(!overload_possible)
|
||||
verbs -= /obj/mecha/verb/toggle_overload
|
||||
if(!zoom_possible)
|
||||
verbs -= /obj/mecha/verb/toggle_zoom
|
||||
if(!phasing_possible)
|
||||
verbs -= /obj/mecha/verb/toggle_phasing
|
||||
if(!switch_dmg_type_possible)
|
||||
verbs -= /obj/mecha/verb/switch_damtype
|
||||
|
||||
occupant.in_enclosed_vehicle = 1 //Useful for when you need to know if someone is in a mecho.
|
||||
>>>>>>> ce9ceb4... Add clickable action buttons from /TG/, rework a lot of backend and other improvements. (#7315)
|
||||
update_cell_alerts()
|
||||
update_damage_alerts()
|
||||
set_dir(dir_in)
|
||||
@@ -1415,6 +1568,7 @@
|
||||
QDEL_NULL(minihud)
|
||||
if(ishuman(occupant))
|
||||
mob_container = src.occupant
|
||||
RemoveActions(occupant, human_occupant=1)//AEIOU
|
||||
else if(istype(occupant, /mob/living/carbon/brain))
|
||||
var/mob/living/carbon/brain/brain = occupant
|
||||
mob_container = brain.container
|
||||
@@ -1434,10 +1588,19 @@
|
||||
occupant.canmove = 0
|
||||
occupant.clear_alert("charge")
|
||||
occupant.clear_alert("mech damage")
|
||||
occupant.in_enclosed_vehicle = 0
|
||||
occupant = null
|
||||
icon_state = src.reset_icon()+"-open"
|
||||
set_dir(dir_in)
|
||||
verbs -= /obj/mecha/verb/eject
|
||||
|
||||
//src.zoom = 0
|
||||
|
||||
// Doesn't seem needed.
|
||||
if(src.occupant && src.occupant.client)
|
||||
src.occupant.client.view = world.view
|
||||
src.zoom = 0
|
||||
|
||||
strafing = 0
|
||||
return
|
||||
|
||||
@@ -1567,7 +1730,18 @@
|
||||
<b>Lights: </b>[lights?"on":"off"]<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]
|
||||
"}
|
||||
//Cargo components.
|
||||
|
||||
|
||||
if(defence_mode_possible)
|
||||
output += "<b>Defence mode: [defence_mode?"on":"off"]</b><br>"
|
||||
if(overload_possible)
|
||||
output += "<b>Leg actuators overload: [overload?"on":"off"]</b><br>"
|
||||
if(smoke_possible)
|
||||
output += "<b>Smoke:</b> [smoke_reserve]<br>"
|
||||
if(thrusters_possible)
|
||||
output += "<b>Thrusters:</b> [thrusters?"on":"off"]<br>"
|
||||
|
||||
//Cargo components. Keep this last otherwise it does weird alignment issues.
|
||||
output += "<b>Cargo Compartment Contents:</b><div style=\"margin-left: 15px;\">"
|
||||
if(src.cargo.len)
|
||||
for(var/obj/O in src.cargo)
|
||||
@@ -1769,12 +1943,31 @@
|
||||
return
|
||||
if(href_list["toggle_lights"])
|
||||
if(usr != src.occupant) return
|
||||
src.toggle_lights()
|
||||
src.lights()
|
||||
return
|
||||
/*
|
||||
if(href_list["toggle_strafing"])
|
||||
if(usr != src.occupant) return
|
||||
src.strafing()
|
||||
return*/
|
||||
|
||||
if(href_list["toggle_airtank"])
|
||||
if(usr != src.occupant) return
|
||||
src.toggle_internal_tank()
|
||||
src.internal_tank()
|
||||
return
|
||||
if (href_list["toggle_thrusters"])
|
||||
src.toggle_thrusters()
|
||||
if (href_list["smoke"])
|
||||
src.smoke()
|
||||
if (href_list["toggle_zoom"])
|
||||
src.zoom()
|
||||
if(href_list["toggle_defence_mode"])
|
||||
src.defence_mode()
|
||||
if(href_list["switch_damtype"])
|
||||
src.switch_damtype()
|
||||
if(href_list["phasing"])
|
||||
src.phasing()
|
||||
|
||||
if(href_list["rmictoggle"])
|
||||
if(usr != src.occupant) return
|
||||
radio.broadcasting = !radio.broadcasting
|
||||
|
||||
421
code/game/mecha/mecha_actions.dm
Normal file
421
code/game/mecha/mecha_actions.dm
Normal file
@@ -0,0 +1,421 @@
|
||||
//AEIOU
|
||||
//
|
||||
//THIS FILE CONTAINS THE CODE TO ADD THE HUD BUTTONS AND THE MECH ACTIONS THEMSELVES.
|
||||
//
|
||||
//
|
||||
// I better get some free food for this..
|
||||
|
||||
|
||||
|
||||
//
|
||||
/// Adding the buttons things to the player. The interactive, top left things, at least at time of writing.
|
||||
/// If you want it to be only for a special mech, you have to go and make an override like in the durand mech.
|
||||
//
|
||||
|
||||
/obj/mecha/proc/GrantActions(mob/living/user, human_occupant = 0)
|
||||
if(human_occupant)
|
||||
eject_action.Grant(user, src)
|
||||
internals_action.Grant(user, src)
|
||||
cycle_action.Grant(user, src)
|
||||
lights_action.Grant(user, src)
|
||||
stats_action.Grant(user, src)
|
||||
strafing_action.Grant(user, src)//The defaults.
|
||||
|
||||
if(defence_mode_possible)
|
||||
defence_action.Grant(user, src)
|
||||
if(overload_possible)
|
||||
overload_action.Grant(user, src)
|
||||
if(smoke_possible)
|
||||
smoke_action.Grant(user, src)
|
||||
if(zoom_possible)
|
||||
zoom_action.Grant(user, src)
|
||||
if(thrusters_possible)
|
||||
thrusters_action.Grant(user, src)
|
||||
if(phasing_possible)
|
||||
phasing_action.Grant(user, src)
|
||||
if(switch_dmg_type_possible)
|
||||
switch_damtype_action.Grant(user, src)
|
||||
|
||||
/obj/mecha/proc/RemoveActions(mob/living/user, human_occupant = 0)
|
||||
if(human_occupant)
|
||||
eject_action.Remove(user, src)
|
||||
internals_action.Remove(user, src)
|
||||
cycle_action.Remove(user, src)
|
||||
lights_action.Remove(user, src)
|
||||
stats_action.Remove(user, src)
|
||||
strafing_action.Remove(user, src)
|
||||
|
||||
defence_action.Remove(user, src)
|
||||
smoke_action.Remove(user, src)
|
||||
zoom_action.Remove(user, src)
|
||||
thrusters_action.Remove(user, src)
|
||||
phasing_action.Remove(user, src)
|
||||
switch_damtype_action.Remove(user, src)
|
||||
overload_action.Remove(user, src)
|
||||
|
||||
|
||||
|
||||
//
|
||||
////BUTTONS STUFF
|
||||
//
|
||||
|
||||
/datum/action/innate/mecha
|
||||
check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUNNED | AB_CHECK_ALIVE
|
||||
button_icon = 'icons/effects/actions_mecha.dmi'
|
||||
var/obj/mecha/chassis
|
||||
|
||||
/datum/action/innate/mecha/Grant(mob/living/L, obj/mecha/M)
|
||||
if(M)
|
||||
chassis = M
|
||||
..()
|
||||
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_lights
|
||||
name = "Toggle Lights"
|
||||
button_icon_state = "mech_lights_off"
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_lights/Activate()
|
||||
button_icon_state = "mech_lights_[chassis.lights ? "off" : "on"]"
|
||||
button.UpdateIcon()
|
||||
chassis.lights()
|
||||
|
||||
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_internals
|
||||
name = "Toggle Internal Airtank Usage"
|
||||
button_icon_state = "mech_internals_off"
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_internals/Activate()
|
||||
button_icon_state = "mech_internals_[chassis.use_internal_tank ? "off" : "on"]"
|
||||
button.UpdateIcon()
|
||||
chassis.internal_tank()
|
||||
|
||||
|
||||
|
||||
/datum/action/innate/mecha/mech_view_stats
|
||||
name = "View stats"
|
||||
button_icon_state = "mech_view_stats"
|
||||
|
||||
/datum/action/innate/mecha/mech_view_stats/Activate()
|
||||
chassis.view_stats()
|
||||
|
||||
|
||||
|
||||
/datum/action/innate/mecha/mech_eject
|
||||
name = "Eject From Mech"
|
||||
button_icon_state = "mech_eject"
|
||||
|
||||
/datum/action/innate/mecha/mech_eject/Activate()
|
||||
chassis.go_out()
|
||||
|
||||
|
||||
|
||||
/datum/action/innate/mecha/strafe
|
||||
name = "Toggle Mech Strafing"
|
||||
button_icon_state = "mech_strafe_off"
|
||||
|
||||
/datum/action/innate/mecha/strafe/Activate()
|
||||
button_icon_state = "mech_strafe_[chassis.strafing ? "off" : "on"]"
|
||||
button.UpdateIcon()
|
||||
chassis.strafing()
|
||||
|
||||
|
||||
|
||||
/datum/action/innate/mecha/mech_defence_mode
|
||||
name = "Toggle Mech defence mode"
|
||||
button_icon_state = "mech_defense_mode_off"
|
||||
|
||||
/datum/action/innate/mecha/mech_defence_mode/Activate()
|
||||
button_icon_state = "mech_defense_mode_[chassis.defence_mode ? "off" : "on"]"
|
||||
button.UpdateIcon()
|
||||
chassis.defence_mode()
|
||||
|
||||
|
||||
|
||||
/datum/action/innate/mecha/mech_overload_mode
|
||||
name = "Toggle Mech Leg Overload"
|
||||
button_icon_state = "mech_overload_off"
|
||||
|
||||
/datum/action/innate/mecha/mech_overload_mode/Activate()
|
||||
button_icon_state = "mech_overload_[chassis.overload ? "off" : "on"]"
|
||||
button.UpdateIcon()
|
||||
chassis.overload()
|
||||
|
||||
|
||||
|
||||
/datum/action/innate/mecha/mech_smoke
|
||||
name = "Toggle Mech Smoke"
|
||||
button_icon_state = "mech_smoke_off"
|
||||
|
||||
/datum/action/innate/mecha/mech_smoke/Activate()
|
||||
//button_icon_state = "mech_smoke_[chassis.smoke ? "off" : "on"]"
|
||||
//button.UpdateIcon() //Dual colors notneeded ATM
|
||||
chassis.smoke()
|
||||
|
||||
|
||||
|
||||
/datum/action/innate/mecha/mech_zoom
|
||||
name = "Toggle Mech Zoom"
|
||||
button_icon_state = "mech_zoom_off"
|
||||
|
||||
/datum/action/innate/mecha/mech_zoom/Activate()
|
||||
button_icon_state = "mech_zoom_[chassis.zoom ? "off" : "on"]"
|
||||
button.UpdateIcon()
|
||||
chassis.zoom()
|
||||
|
||||
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_thrusters
|
||||
name = "Toggle Mech thrusters"
|
||||
button_icon_state = "mech_thrusters_off"
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_thrusters/Activate()
|
||||
button_icon_state = "mech_thrusters_[chassis.thrusters ? "off" : "on"]"
|
||||
button.UpdateIcon()
|
||||
chassis.thrusters()
|
||||
|
||||
|
||||
|
||||
/datum/action/innate/mecha/mech_cycle_equip //I'll be honest, i don't understand this part, buuuuuut it works!
|
||||
name = "Cycle Equipment"
|
||||
button_icon_state = "mech_cycle_equip_off"
|
||||
|
||||
/datum/action/innate/mecha/mech_cycle_equip/Activate()
|
||||
|
||||
var/list/available_equipment = list()
|
||||
available_equipment = chassis.equipment
|
||||
|
||||
if(available_equipment.len == 0)
|
||||
chassis.occupant_message("No equipment available.")
|
||||
return
|
||||
if(!chassis.selected)
|
||||
chassis.selected = available_equipment[1]
|
||||
chassis.occupant_message("You select [chassis.selected]")
|
||||
send_byjax(chassis.occupant,"exosuit.browser","eq_list",chassis.get_equipment_list())
|
||||
button_icon_state = "mech_cycle_equip_on"
|
||||
button.UpdateIcon()
|
||||
return
|
||||
var/number = 0
|
||||
for(var/A in available_equipment)
|
||||
number++
|
||||
if(A == chassis.selected)
|
||||
if(available_equipment.len == number)
|
||||
chassis.selected = null
|
||||
chassis.occupant_message("You switch to no equipment")
|
||||
button_icon_state = "mech_cycle_equip_off"
|
||||
else
|
||||
chassis.selected = available_equipment[number+1]
|
||||
chassis.occupant_message("You switch to [chassis.selected]")
|
||||
button_icon_state = "mech_cycle_equip_on"
|
||||
send_byjax(chassis.occupant,"exosuit.browser","eq_list",chassis.get_equipment_list())
|
||||
button.UpdateIcon()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/datum/action/innate/mecha/mech_switch_damtype
|
||||
name = "Reconfigure arm microtool arrays"
|
||||
button_icon_state = "mech_damtype_brute"
|
||||
|
||||
|
||||
/datum/action/innate/mecha/mech_switch_damtype/Activate()
|
||||
|
||||
|
||||
button_icon_state = "mech_damtype_[chassis.damtype]"
|
||||
playsound(src, 'sound/mecha/mechmove01.ogg', 50, 1)
|
||||
button.UpdateIcon()
|
||||
chassis.query_damtype()
|
||||
|
||||
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_phasing
|
||||
name = "Toggle Mech phasing"
|
||||
button_icon_state = "mech_phasing_off"
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_phasing/Activate()
|
||||
button_icon_state = "mech_phasing_[chassis.phasing ? "off" : "on"]"
|
||||
button.UpdateIcon()
|
||||
chassis.phasing()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/////
|
||||
/////
|
||||
///// ACTUAL MECANICS FOR THE ACTIONS
|
||||
///// OVERLOAD, DEFENCE, SMOKE
|
||||
/////
|
||||
/////
|
||||
|
||||
|
||||
/obj/mecha/verb/toggle_defence_mode()
|
||||
set category = "Exosuit Interface"
|
||||
set name = "Toggle defence mode"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
defence_mode()
|
||||
|
||||
/obj/mecha/proc/defence_mode()
|
||||
if(usr!=src.occupant)
|
||||
return
|
||||
playsound(src, 'sound/mecha/duranddefencemode.ogg', 50, 1)
|
||||
defence_mode = !defence_mode
|
||||
if(defence_mode)
|
||||
deflect_chance = defence_deflect
|
||||
src.occupant_message("<font color='blue'>You enable [src] defence mode.</font>")
|
||||
else
|
||||
deflect_chance = initial(deflect_chance)
|
||||
src.occupant_message("<font color='red'>You disable [src] defence mode.</font>")
|
||||
src.log_message("Toggled defence mode.")
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/mecha/verb/toggle_overload()
|
||||
set category = "Exosuit Interface"
|
||||
set name = "Toggle leg actuators overload"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
overload()
|
||||
|
||||
/obj/mecha/proc/overload()
|
||||
if(usr.stat == 1)//No manipulating things while unconcious.
|
||||
return
|
||||
if(usr!=src.occupant)
|
||||
return
|
||||
if(health < initial(health) - initial(health)/3)//Same formula as in movement, just beforehand.
|
||||
src.occupant_message("<font color='red'>Leg actuators damage critical, unable to engage overload.</font>")
|
||||
overload = 0 //Just to be sure
|
||||
return
|
||||
if(overload)
|
||||
overload = 0
|
||||
step_in = initial(step_in)
|
||||
step_energy_drain = initial(step_energy_drain)
|
||||
src.occupant_message("<font color='blue'>You disable leg actuators overload.</font>")
|
||||
else
|
||||
overload = 1
|
||||
step_in = min(1, round(step_in/2))
|
||||
step_energy_drain = step_energy_drain*overload_coeff
|
||||
src.occupant_message("<font color='red'>You enable leg actuators overload.</font>")
|
||||
src.log_message("Toggled leg actuators overload.")
|
||||
playsound(src, 'sound/mecha/mechanical_toggle.ogg', 50, 1)
|
||||
return
|
||||
|
||||
|
||||
/obj/mecha/verb/toggle_smoke()
|
||||
set category = "Exosuit Interface"
|
||||
set name = "Activate Smoke"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
smoke()
|
||||
|
||||
/obj/mecha/proc/smoke()
|
||||
if(usr!=src.occupant)
|
||||
return
|
||||
|
||||
if(smoke_reserve < 1)
|
||||
src.occupant_message("<font color='red'>You don't have any smoke left in stock!</font>")
|
||||
return
|
||||
|
||||
if(smoke_ready)
|
||||
smoke_reserve-- //Remove ammo
|
||||
src.occupant_message("<font color='red'>Smoke fired. [smoke_reserve] usages left.</font>")
|
||||
|
||||
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
|
||||
smoke.attach(src)
|
||||
smoke.set_up(10, 0, usr.loc)
|
||||
smoke.start()
|
||||
playsound(src, 'sound/effects/smoke.ogg', 50, 1, -3)
|
||||
|
||||
smoke_ready = 0
|
||||
spawn(smoke_cooldown)
|
||||
smoke_ready = 1
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/mecha/verb/toggle_zoom()
|
||||
set category = "Exosuit Interface"
|
||||
set name = "Zoom"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
zoom()
|
||||
|
||||
/obj/mecha/proc/zoom()//This could use improvements but maybe later.
|
||||
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.set_viewsize(12)
|
||||
src.occupant << sound('sound/mecha/imag_enh.ogg',volume=50)
|
||||
else
|
||||
src.occupant.set_viewsize() // Reset to default
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/mecha/verb/toggle_thrusters()
|
||||
set category = "Exosuit Interface"
|
||||
set name = "Toggle thrusters"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
thrusters()
|
||||
|
||||
/obj/mecha/proc/thrusters()
|
||||
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.</font>")
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/mecha/verb/switch_damtype()
|
||||
set category = "Exosuit Interface"
|
||||
set name = "Change melee damage type"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
query_damtype()
|
||||
|
||||
/obj/mecha/proc/query_damtype()
|
||||
if(usr!=src.occupant)
|
||||
return
|
||||
var/new_damtype = alert(src.occupant,"Melee Damage Type",null,"Brute","Fire","Toxic")
|
||||
switch(new_damtype)
|
||||
if("Brute")
|
||||
damtype = "brute"
|
||||
src.occupant_message("Your exosuit's hands form into fists.")
|
||||
if("Fire")
|
||||
damtype = "fire"
|
||||
src.occupant_message("A torch tip extends from your exosuit's hand, glowing red.")
|
||||
if("Toxic")
|
||||
damtype = "tox"
|
||||
src.occupant_message("A bone-chillingly thick plasteel needle protracts from the exosuit's palm.")
|
||||
src.occupant_message("Melee damage type switched to [new_damtype]")
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/mecha/verb/toggle_phasing()
|
||||
set category = "Exosuit Interface"
|
||||
set name = "Toggle phasing"
|
||||
set src = usr.loc
|
||||
set popup_menu = 0
|
||||
phasing()
|
||||
|
||||
/obj/mecha/proc/phasing()
|
||||
if(usr!=src.occupant)
|
||||
return
|
||||
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
|
||||
|
||||
|
||||
@@ -224,4 +224,8 @@
|
||||
|
||||
var/registered_z
|
||||
|
||||
var/list/progressbars = null //for stacking do_after bars
|
||||
<<<<<<< HEAD
|
||||
var/list/progressbars = null //for stacking do_after bars
|
||||
=======
|
||||
var/in_enclosed_vehicle = 0 //For mechs and fighters ambiance. Can be used in other cases.
|
||||
>>>>>>> ce9ceb4... Add clickable action buttons from /TG/, rework a lot of backend and other improvements. (#7315)
|
||||
|
||||
BIN
icons/effects/actions_mecha.dmi
Normal file
BIN
icons/effects/actions_mecha.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.5 KiB |
@@ -922,6 +922,7 @@
|
||||
#include "code\game\mecha\mech_prosthetics.dm"
|
||||
#include "code\game\mecha\mech_sensor.dm"
|
||||
#include "code\game\mecha\mecha.dm"
|
||||
#include "code\game\mecha\mecha_actions.dm"
|
||||
#include "code\game\mecha\mecha_construction_paths.dm"
|
||||
#include "code\game\mecha\mecha_control_console.dm"
|
||||
#include "code\game\mecha\mecha_helpers.dm"
|
||||
|
||||
Reference in New Issue
Block a user