Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ports mech fixes part 2 #11149

Merged
merged 24 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
74f5c4d
equipment pr 1
Tsar-Salat May 21, 2024
60e0fd1
mecha pilots
Tsar-Salat May 21, 2024
4331d61
timperpoes mechacontrolconsole runtime
Tsar-Salat May 21, 2024
17e4794
tiviplus mech refactor 4
Tsar-Salat May 21, 2024
16c2c00
https://github.com/tgstation/tgstation/pull/61165
Tsar-Salat May 21, 2024
acfea6c
https://github.com/tgstation/tgstation/pull/61163
Tsar-Salat May 21, 2024
1ca1f9d
This is now... technically unecessary. So long.
Tsar-Salat May 21, 2024
0e52c07
tiviplus mech refactor 5
Tsar-Salat May 21, 2024
ff3c6c1
Merge remote-tracking branch 'BeeStation/master' into mech-fix2
Tsar-Salat Jun 16, 2024
5eb26f9
mechhud fix
Tsar-Salat Jun 16, 2024
bd714a7
Merge remote-tracking branch 'BeeStation/master' into mech-fix2
Tsar-Salat Jul 3, 2024
9a14ee1
conflict
Tsar-Salat Jul 3, 2024
068d3d5
fix phazon phasing
Tsar-Salat Jul 3, 2024
f1e5e6a
weird runtime
Tsar-Salat Jul 3, 2024
a4c4b7e
Merge remote-tracking branch 'BeeStation/master' into mech-fix2
Tsar-Salat Jul 16, 2024
e4b7e78
Merge remote-tracking branch 'BeeStation/master' into mech-fix2
Tsar-Salat Jul 30, 2024
5f67c34
Merge remote-tracking branch 'BeeStation/master' into mech-fix2
Tsar-Salat Aug 8, 2024
5c0bfdb
convert to delta_time
Tsar-Salat Aug 8, 2024
fb1d82c
fix
Tsar-Salat Aug 8, 2024
3e32483
Merge remote-tracking branch 'BeeStation/master' into mech-fix2
Tsar-Salat Aug 24, 2024
aba88b7
fix clarke
Tsar-Salat Aug 25, 2024
efecb94
MERGE SKEW RAAAGH
Tsar-Salat Aug 28, 2024
0a471b8
Merge remote-tracking branch 'BeeStation/master' into mech-fix2
Tsar-Salat Sep 8, 2024
62d8e34
mapload
Tsar-Salat Sep 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list(

#define ismecha(A) (istype(A, /obj/vehicle/sealed/mecha))

#define ismedicalmecha(A) (istype(A, /obj/vehicle/sealed/mecha/medical))

#define ismopable(A) (A && (A.layer <= HIGH_SIGIL_LAYER)) //If something can be cleaned by floor-cleaning devices such as mops or clean bots

#define isorgan(A) (istype(A, /obj/item/organ))
Expand Down
5 changes: 4 additions & 1 deletion code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -695,11 +695,14 @@


/atom/movable/proc/newtonian_move(direction, instant = FALSE) // Accepts the direction to move, and if the push should be instant
if(!loc || Process_Spacemove(0) || !direction)
if(!isturf(loc) || Process_Spacemove(0) || !direction)
return FALSE

if(SEND_SIGNAL(src, COMSIG_MOVABLE_NEWTONIAN_MOVE, direction) & COMPONENT_MOVABLE_NEWTONIAN_BLOCK)
return TRUE

AddComponent(/datum/component/drift, direction, instant)

return TRUE

/atom/movable/proc/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
Expand Down
70 changes: 0 additions & 70 deletions code/game/gamemodes/clown_ops/clown_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -252,73 +252,3 @@

/obj/item/clothing/mask/fakemoustache/sticky/proc/unstick()
REMOVE_TRAIT(src, TRAIT_NODROP, STICKY_MOUSTACHE_TRAIT)

//DARK H.O.N.K. AND CLOWN MECH WEAPONS

/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/banana_mortar/bombanana
name = "bombanana mortar"
desc = "Equipment for clown exosuits. Launches exploding banana peels."
icon_state = "mecha_bananamrtr"
projectile = /obj/item/grown/bananapeel/bombanana
projectiles = 8
projectile_energy_cost = 1000

/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/banana_mortar/bombanana/can_attach(obj/vehicle/sealed/mecha/combat/honker/M)
if(..())
if(istype(M))
return TRUE
return FALSE

/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/flashbang/tearstache
name = "\improper HONKeR-6 grenade launcher"
desc = "A weapon for combat exosuits. Launches primed tear-stache grenades."
icon_state = "mecha_grenadelnchr"
projectile = /obj/item/grenade/chem_grenade/teargas/moustache
fire_sound = 'sound/weapons/grenadelaunch.ogg'
projectiles = 6
missile_speed = 1.5
projectile_energy_cost = 800
equip_cooldown = 60
det_time = 20

/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/flashbang/tearstache/can_attach(obj/vehicle/sealed/mecha/combat/honker/M)
if(..())
if(istype(M))
return TRUE
return FALSE

/obj/vehicle/sealed/mecha/combat/honker/dark
desc = "Produced by \"Tyranny of Honk, INC\", this exosuit is designed as heavy clown-support. This one has been painted black for maximum fun. HONK!"
name = "\improper Dark H.O.N.K"
icon_state = "darkhonker"
base_icon_state = "darkhonker"
max_integrity = 300
deflect_chance = 15
armor = list(MELEE = 40, BULLET = 40, LASER = 50, ENERGY = 35, BOMB = 20, BIO = 0, RAD = 0, FIRE = 100, ACID = 100, STAMINA = 0, BLEED = 0)
max_temperature = 35000
operation_req_access = list(ACCESS_SYNDICATE)
internals_req_access = list(ACCESS_SYNDICATE)
wreckage = /obj/structure/mecha_wreckage/honker/dark
max_equip = 4

/obj/vehicle/sealed/mecha/combat/honker/dark/add_cell(obj/item/stock_parts/cell/C)
if(C)
C.forceMove(src)
cell = C
return
cell = new /obj/item/stock_parts/cell/hyper(src)

/obj/vehicle/sealed/mecha/combat/honker/dark/loaded/Initialize(mapload)
. = ..()
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/thrusters/ion(src)
ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/honker()
ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/banana_mortar/bombanana()//Needed more offensive weapons.
ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/flashbang/tearstache()//The mousetrap mortar was not up-to-snuff.
ME.attach(src)

/obj/structure/mecha_wreckage/honker/dark
name = "\improper Dark H.O.N.K wreckage"
icon_state = "darkhonker-broken"
2 changes: 1 addition & 1 deletion code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp

// Ghosts have no momentum, being massless ectoplasm
/mob/dead/observer/Process_Spacemove(movement_dir)
return 1
return TRUE

/mob/dead/observer/vv_edit_var(var_name, var_value)
. = ..()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,6 @@

/mob/living/simple_animal/hostile/syndicate/mecha_pilot/Goto(target, delay, minimum_distance)
if(mecha)
SSmove_manager.move_to(mecha, target, minimum_distance, mecha.movedelay * mecha.step_multiplier)
SSmove_manager.move_to(mecha, target, minimum_distance, mecha.movedelay)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only real remaining use case of step_multiplier after the previous pr.

Gonna test that simple mobs respect the vehicles movement delay with the multiplier removed. That's really my only worry in this pr.

Player mobs driving mechs seems completely fine

else
..()
3 changes: 2 additions & 1 deletion code/modules/mob/mob_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@
* You can move in space if you have a spacewalk ability
*/
/mob/Process_Spacemove(movement_dir = 0)
if(spacewalk || ..())
. = ..()
if(. ||spacewalk)
return TRUE
var/atom/movable/backup = get_spacemove_backup(movement_dir)
if(backup)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/projectiles/ammunition/_ammunition.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
return ..()

/obj/item/ammo_casing/update_icon()
..()
. = ..()
icon_state = "[initial(icon_state)][BB ? "-live" : ""]"
desc = "[initial(desc)][BB ? "" : " This one is spent."]"

Expand Down Expand Up @@ -88,7 +88,7 @@
/obj/item/ammo_casing/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(heavy_metal)
bounce_away(FALSE, NONE)
. = ..()
return ..()

/obj/item/ammo_casing/proc/bounce_away(still_warm = FALSE, bounce_delay = 3)
update_icon()
Expand Down
17 changes: 13 additions & 4 deletions code/modules/projectiles/ammunition/special/syringe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,16 @@
SG.syringes.Remove(S)
S.forceMove(BB)
D.syringe = S
..()
else if(istype(loc, /obj/item/mecha_parts/mecha_equipment/medical/syringe_gun))
var/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/syringe_gun = loc
var/obj/item/reagent_containers/syringe/loaded_syringe = syringe_gun.syringes[1]
var/obj/projectile/bullet/dart/shot_dart = BB
syringe_gun.reagents.trans_to(shot_dart, min(loaded_syringe.volume, syringe_gun.reagents.total_volume), transfered_by = user)
shot_dart.name = loaded_syringe.name
shot_dart.piercing = loaded_syringe.proj_piercing
LAZYREMOVE(syringe_gun.syringes, loaded_syringe)
qdel(loaded_syringe)
return ..()

/obj/item/ammo_casing/chemgun
name = "dart synthesiser"
Expand All @@ -37,7 +46,7 @@
CG.reagents.trans_to(BB, 15, transfered_by = user)
BB.name = "chemical dart"
CG.syringes_left--
..()
return ..()

/obj/item/ammo_casing/bee
name = "bee synthesiser"
Expand All @@ -55,7 +64,7 @@
CG.reagents.trans_to(BB, 5, transfered_by = user)
BB.name = "bee"
CG.syringes_left--
..()
return ..()

/obj/item/ammo_casing/dnainjector
name = "rigged syringe gun spring"
Expand All @@ -75,5 +84,5 @@
var/obj/projectile/bullet/dnainjector/D = BB
S.forceMove(D)
D.injector = S
..()
return ..()

15 changes: 8 additions & 7 deletions code/modules/vehicles/_vehicle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
return occupants

/obj/vehicle/proc/occupant_amount()
return length(occupants)
return LAZYLEN(occupants)

/obj/vehicle/proc/return_amount_of_controllers_with_flag(flag)
. = 0
Expand All @@ -85,12 +85,13 @@
return is_occupant(M) && occupants[M] & VEHICLE_CONTROL_DRIVE

/obj/vehicle/proc/is_occupant(mob/M)
return !isnull(occupants[M])
return !isnull(LAZYACCESS(occupants, M))

/obj/vehicle/proc/add_occupant(mob/M, control_flags)
if(!istype(M) || occupants[M])
if(!istype(M) || is_occupant(M))
return FALSE
occupants[M] = NONE

LAZYSET(occupants, M, NONE)
add_control_flags(M, control_flags)
after_add_occupant(M)
grant_passenger_actions(M)
Expand All @@ -108,7 +109,7 @@
return FALSE
remove_control_flags(M, ALL)
remove_passenger_actions(M)
occupants -= M
LAZYREMOVE(occupants, M)
cleanup_actions_for_mob(M)
after_remove_occupant(M)
return TRUE
Expand Down Expand Up @@ -149,7 +150,7 @@
return

/obj/vehicle/proc/add_control_flags(mob/controller, flags)
if(!istype(controller) || !flags)
if(!is_occupant(controller) || !flags)
return FALSE
occupants[controller] |= flags
for(var/i in GLOB.bitflags)
Expand All @@ -158,7 +159,7 @@
return TRUE

/obj/vehicle/proc/remove_control_flags(mob/controller, flags)
if(!istype(controller) || !flags)
if(!is_occupant(controller) || !flags)
return FALSE
occupants[controller] &= ~flags
for(var/i in GLOB.bitflags)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/vehicles/cars/car.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
return ..()

/obj/vehicle/sealed/car/mob_try_exit(mob/M, mob/user, silent = FALSE)
if(M == user && (occupants[M] & VEHICLE_CONTROL_KIDNAPPED))
if(M == user && (LAZYACCESS(occupants, M) & VEHICLE_CONTROL_KIDNAPPED))
to_chat(user, "<span class='notice'>You push against the back of [src] trunk to try and get out.</span>")
if(!do_after(user, escape_time, target = src))
return FALSE
Expand Down
Loading
Loading