mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
Fix mechs not using power to move, gygax leg actuator button not matching actual state, and mechpads not working (#53624)
Fixes these issues with mechs:
Mechs aren't using power to move (broken in #52902)
Gygax leg actuator button is opposite of what it should be (off when it should be on) (broken in #52902)
Mechpads don't actually send mechs
None of the error messages for failing to move work
This commit is contained in:
@@ -61,6 +61,7 @@
|
||||
style = STYLE_SEETHROUGH
|
||||
explosionSize = list(0,0,0,0)
|
||||
reversing = TRUE
|
||||
reverse_option_list = list("Mobs"=FALSE,"Objects"=FALSE,"Anchored"=FALSE,"Underfloor"=FALSE,"Wallmounted"=FALSE,"Floors"=FALSE,"Walls"=FALSE,"Mecha"=TRUE)
|
||||
landingDelay = 0
|
||||
openingDelay = 0
|
||||
departureDelay = 0
|
||||
@@ -69,8 +70,3 @@
|
||||
leavingSound = 'sound/vehicles/rocketlaunch.ogg'
|
||||
close_sound = null
|
||||
pod_flags = FIRST_SOUNDS
|
||||
|
||||
/obj/structure/closet/supplypod/mechpod/insertion_allowed(atom/movable/AM)
|
||||
if(!ismecha(AM))
|
||||
return FALSE
|
||||
. = ..()
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
data["effectCircle"] = temp_pod.effectCircle //If true, allows the pod to come in at any angle. Bit of a weird feature but whatever its here
|
||||
data["effectBurst"] = effectBurst //IOf true, launches five pods at once (with a very small delay between for added coolness), in a 3x3 area centered around the area
|
||||
data["effectReverse"] = temp_pod.reversing //If true, the pod will not send any items. Instead, after opening, it will close again (picking up items/mobs) and fly back to centcom
|
||||
data["reverseOptionList"] = temp_pod.reverseOptionList
|
||||
data["reverse_option_list"] = temp_pod.reverse_option_list
|
||||
data["effectTarget"] = specificTarget //Launches the pod at the turf of a specific mob target, rather than wherever the user clicked. Useful for smites
|
||||
data["effectName"] = temp_pod.adminNamed //Determines whether or not the pod has been named by an admin. If true, the pod's name will not get overridden when the style of the pod changes (changing the style of the pod normally also changes the name+desc)
|
||||
data["podName"] = temp_pod.name
|
||||
@@ -397,7 +397,7 @@
|
||||
. = TRUE
|
||||
if("reverseOption")
|
||||
var/reverseOption = params["reverseOption"]
|
||||
temp_pod.reverseOptionList[reverseOption] = !temp_pod.reverseOptionList[reverseOption]
|
||||
temp_pod.reverse_option_list[reverseOption] = !temp_pod.reverse_option_list[reverseOption]
|
||||
. = TRUE
|
||||
if("effectTarget") //Toggle: Launch at a specific mob (instead of at whatever turf you click on). Used for the supplypod smite
|
||||
if (specificTarget)
|
||||
@@ -817,7 +817,7 @@
|
||||
temp_pod.effectCircle = dataToLoad["effectCircle"] //If true, allows the pod to come in at any angle. Bit of a weird feature but whatever its here
|
||||
effectBurst = dataToLoad["effectBurst"] //IOf true, launches five pods at once (with a very small delay between for added coolness), in a 3x3 area centered around the area
|
||||
temp_pod.reversing = dataToLoad["effectReverse"] //If true, the pod will not send any items. Instead, after opening, it will close again (picking up items/mobs) and fly back to centcom
|
||||
temp_pod.reverseOptionList = dataToLoad["reverseOptionList"]
|
||||
temp_pod.reverse_option_list = dataToLoad["reverse_option_list"]
|
||||
specificTarget = dataToLoad["effectTarget"] //Launches the pod at the turf of a specific mob target, rather than wherever the user clicked. Useful for smites
|
||||
temp_pod.adminNamed = dataToLoad["effectName"] //Determines whether or not the pod has been named by an admin. If true, the pod's name will not get overridden when the style of the pod changes (changing the style of the pod normally also changes the name+desc)
|
||||
temp_pod.name = dataToLoad["podName"]
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
var/effectShrapnel = FALSE
|
||||
var/shrapnel_type = /obj/projectile/bullet/shrapnel
|
||||
var/shrapnel_magnitude = 3
|
||||
var/list/reverseOptionList = list("Mobs"=FALSE,"Objects"=FALSE,"Anchored"=FALSE,"Underfloor"=FALSE,"Wallmounted"=FALSE,"Floors"=FALSE,"Walls"=FALSE)
|
||||
var/list/reverse_option_list = list("Mobs"=FALSE,"Objects"=FALSE,"Anchored"=FALSE,"Underfloor"=FALSE,"Wallmounted"=FALSE,"Floors"=FALSE,"Walls"=FALSE, "Mecha"=FALSE)
|
||||
var/list/turfs_in_cargo = list()
|
||||
|
||||
/obj/structure/closet/supplypod/bluespacepod
|
||||
@@ -355,7 +355,7 @@
|
||||
if(to_insert.invisibility == INVISIBILITY_ABSTRACT)
|
||||
return FALSE
|
||||
if(ismob(to_insert))
|
||||
if(!reverseOptionList["Mobs"])
|
||||
if(!reverse_option_list["Mobs"])
|
||||
return FALSE
|
||||
if(!isliving(to_insert)) //let's not put ghosts or camera mobs inside
|
||||
return FALSE
|
||||
@@ -374,28 +374,30 @@
|
||||
return FALSE
|
||||
if(istype(obj_to_insert, /obj/effect/supplypod_rubble))
|
||||
return FALSE
|
||||
if((obj_to_insert.comp_lookup && obj_to_insert.comp_lookup[COMSIG_OBJ_HIDE]) && reverseOptionList["Underfloor"])
|
||||
if((obj_to_insert.comp_lookup && obj_to_insert.comp_lookup[COMSIG_OBJ_HIDE]) && reverse_option_list["Underfloor"])
|
||||
return TRUE
|
||||
else if ((obj_to_insert.comp_lookup && obj_to_insert.comp_lookup[COMSIG_OBJ_HIDE]) && !reverseOptionList["Underfloor"])
|
||||
else if ((obj_to_insert.comp_lookup && obj_to_insert.comp_lookup[COMSIG_OBJ_HIDE]) && !reverse_option_list["Underfloor"])
|
||||
return FALSE
|
||||
if(isProbablyWallMounted(obj_to_insert) && reverseOptionList["Wallmounted"])
|
||||
if(isProbablyWallMounted(obj_to_insert) && reverse_option_list["Wallmounted"])
|
||||
return TRUE
|
||||
else if (isProbablyWallMounted(obj_to_insert) && !reverseOptionList["Wallmounted"])
|
||||
else if (isProbablyWallMounted(obj_to_insert) && !reverse_option_list["Wallmounted"])
|
||||
return FALSE
|
||||
if(!obj_to_insert.anchored && reverseOptionList["Unanchored"])
|
||||
if(!obj_to_insert.anchored && reverse_option_list["Unanchored"])
|
||||
return TRUE
|
||||
if(obj_to_insert.anchored && reverseOptionList["Anchored"])
|
||||
if(obj_to_insert.anchored && !ismecha(obj_to_insert) && reverse_option_list["Anchored"]) //Mecha are anchored but there is a separate option for them
|
||||
return TRUE
|
||||
if(ismecha(obj_to_insert) && reverse_option_list["Mecha"])
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
else if (isturf(to_insert))
|
||||
if(isfloorturf(to_insert) && reverseOptionList["Floors"])
|
||||
if(isfloorturf(to_insert) && reverse_option_list["Floors"])
|
||||
return TRUE
|
||||
if(isfloorturf(to_insert) && !reverseOptionList["Floors"])
|
||||
if(isfloorturf(to_insert) && !reverse_option_list["Floors"])
|
||||
return FALSE
|
||||
if(isclosedturf(to_insert) && reverseOptionList["Walls"])
|
||||
if(isclosedturf(to_insert) && reverse_option_list["Walls"])
|
||||
return TRUE
|
||||
if(isclosedturf(to_insert) && !reverseOptionList["Walls"])
|
||||
if(isclosedturf(to_insert) && !reverse_option_list["Walls"])
|
||||
return FALSE
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
@@ -615,31 +615,42 @@
|
||||
if(!direction)
|
||||
return FALSE
|
||||
if(internal_tank?.connected_port)
|
||||
if(TIMER_COOLDOWN_CHECK(src, COOLDOWN_MECHA_MESSAGE))
|
||||
if(!TIMER_COOLDOWN_CHECK(src, COOLDOWN_MECHA_MESSAGE))
|
||||
to_chat(occupants, "[icon2html(src, occupants)]<span class='warning'>Unable to move while connected to the air system port!</span>")
|
||||
TIMER_COOLDOWN_START(src, COOLDOWN_MECHA_MESSAGE, 2 SECONDS)
|
||||
return FALSE
|
||||
if(construction_state)
|
||||
if(TIMER_COOLDOWN_CHECK(src, COOLDOWN_MECHA_MESSAGE))
|
||||
if(!TIMER_COOLDOWN_CHECK(src, COOLDOWN_MECHA_MESSAGE))
|
||||
to_chat(occupants, "[icon2html(src, occupants)]<span class='danger'>Maintenance protocols in effect.</span>")
|
||||
TIMER_COOLDOWN_START(src, COOLDOWN_MECHA_MESSAGE, 2 SECONDS)
|
||||
return FALSE
|
||||
|
||||
if(!Process_Spacemove(direction))
|
||||
return FALSE
|
||||
if(!has_charge(step_energy_drain))
|
||||
return FALSE
|
||||
if(zoom_mode)
|
||||
to_chat(occupants, "[icon2html(src, occupants)]<span class='warning'>Unable to move while in zoom mode!</span>")
|
||||
if(!TIMER_COOLDOWN_CHECK(src, COOLDOWN_MECHA_MESSAGE))
|
||||
to_chat(occupants, "[icon2html(src, occupants)]<span class='warning'>Unable to move while in zoom mode!</span>")
|
||||
TIMER_COOLDOWN_START(src, COOLDOWN_MECHA_MESSAGE, 2 SECONDS)
|
||||
return FALSE
|
||||
if(!cell)
|
||||
to_chat(occupants, "[icon2html(src, occupants)]<span class='warning'>Missing power cell.</span>")
|
||||
if(!TIMER_COOLDOWN_CHECK(src, COOLDOWN_MECHA_MESSAGE))
|
||||
to_chat(occupants, "[icon2html(src, occupants)]<span class='warning'>Missing power cell.</span>")
|
||||
TIMER_COOLDOWN_START(src, COOLDOWN_MECHA_MESSAGE, 2 SECONDS)
|
||||
return FALSE
|
||||
if(!scanmod || !capacitor)
|
||||
to_chat(occupants, "[icon2html(src, occupants)]<span class='warning'>Missing [scanmod? "capacitor" : "scanning module"].</span>")
|
||||
if(!TIMER_COOLDOWN_CHECK(src, COOLDOWN_MECHA_MESSAGE))
|
||||
to_chat(occupants, "[icon2html(src, occupants)]<span class='warning'>Missing [scanmod? "capacitor" : "scanning module"].</span>")
|
||||
TIMER_COOLDOWN_START(src, COOLDOWN_MECHA_MESSAGE, 2 SECONDS)
|
||||
return FALSE
|
||||
if(!use_power(step_energy_drain))
|
||||
if(!TIMER_COOLDOWN_CHECK(src, COOLDOWN_MECHA_MESSAGE))
|
||||
to_chat(occupants, "[icon2html(src, occupants)]<span class='warning'>Insufficient power to move!</span>")
|
||||
TIMER_COOLDOWN_START(src, COOLDOWN_MECHA_MESSAGE, 2 SECONDS)
|
||||
return FALSE
|
||||
if(lavaland_only && is_mining_level(z))
|
||||
to_chat(occupants, "[icon2html(src, occupants)]<span class='warning'>Invalid Environment.</span>")
|
||||
if(!TIMER_COOLDOWN_CHECK(src, COOLDOWN_MECHA_MESSAGE))
|
||||
to_chat(occupants, "[icon2html(src, occupants)]<span class='warning'>Invalid Environment.</span>")
|
||||
TIMER_COOLDOWN_START(src, COOLDOWN_MECHA_MESSAGE, 2 SECONDS)
|
||||
return FALSE
|
||||
|
||||
var/olddir = dir
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
chassis.leg_overload_mode = !chassis.leg_overload_mode
|
||||
button_icon_state = "mech_overload_[chassis.leg_overload_mode ? "on" : "off"]"
|
||||
chassis.log_message("Toggled leg actuators overload.", LOG_MECHA)
|
||||
if(!chassis.leg_overload_mode)
|
||||
if(chassis.leg_overload_mode)
|
||||
chassis.movedelay = min(1, round(chassis.movedelay * 0.5))
|
||||
chassis.step_energy_drain = max(chassis.overload_step_energy_drain_min,chassis.step_energy_drain*chassis.leg_overload_coeff)
|
||||
to_chat(owner, "[icon2html(chassis, owner)]<span class='danger'>You enable leg actuators overload.</span>")
|
||||
|
||||
@@ -28,7 +28,7 @@ export const CentcomPodLauncher = (props, context) => {
|
||||
? "Use against Helen Weinstein"
|
||||
: "Supply Pod Menu (Use against Helen Weinstein)"}
|
||||
overflow="hidden"
|
||||
width={compact ? 435 : 690}
|
||||
width={compact ? 435 : 730}
|
||||
height={compact ? 360 : 440}>
|
||||
<CentcomPodLauncherContent />
|
||||
</Window>
|
||||
@@ -45,7 +45,7 @@ const CentcomPodLauncherContent = (props, context) => {
|
||||
</Flex.Item>
|
||||
<Flex.Item mt={1} grow={1}>
|
||||
<Flex height="100%">
|
||||
<Flex.Item grow={1} shrink={0} basis="13em">
|
||||
<Flex.Item grow={1} shrink={0} basis="14.1em">
|
||||
<Flex direction="column" height="100%" >
|
||||
<Flex.Item grow={1}>
|
||||
<PresetsPage />
|
||||
@@ -139,6 +139,12 @@ const REVERSE_OPTIONS = [
|
||||
icon: 'square',
|
||||
|
||||
},
|
||||
{
|
||||
title: 'Mechs',
|
||||
key: 'Mecha',
|
||||
icon: 'truck',
|
||||
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -749,8 +755,8 @@ const ReverseMenu = (props, context) => {
|
||||
disabled={!data.effectReverse}
|
||||
selected={
|
||||
option.key
|
||||
? data.reverseOptionList[option.key]
|
||||
: data.reverseOptionList[option.title]
|
||||
? data.reverse_option_list[option.key]
|
||||
: data.reverse_option_list[option.title]
|
||||
}
|
||||
tooltip={option.title}
|
||||
tooltipOverrideLong
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user