Skip to content

Commit

Permalink
Merge branch 'master' into craftable-vehicles2
Browse files Browse the repository at this point in the history
  • Loading branch information
xTrainx authored Apr 8, 2024
2 parents b0d621e + dab4ae2 commit d176787
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 12 deletions.
19 changes: 19 additions & 0 deletions code/game/mecha/combat/phazon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
movement_type = FLYING
stepsound = 'sound/f13machines/vertibird_loop.ogg'
turnsound = 'sound/f13machines/vertibird_loop.ogg'
on_the_air = TRUE

/obj/structure/mecha_wreckage/vertibird
name = "\improper Vertibird Wreck"
Expand All @@ -75,6 +76,7 @@
strafing_action.Grant(user, src)
zoom_action.Grant(user, src)
eject_action.Grant(user, src)
landing_action.Grant(user, src)
//rotorup_action.Grant(user, src)
//rotordown_action.Grant(user, src)

Expand All @@ -86,6 +88,7 @@
strafing_action.Remove(user)
zoom_action.Remove(user)
eject_action.Remove(user)
landing_action.Grant(user)
//rotorup_action.Remove(user)
//rotordown_action.Remove(user)

Expand All @@ -103,6 +106,8 @@

/obj/mecha/combat/phazon/vertibird/loaded/Initialize()
. = ..()
if(z != 5)
on_the_air = FALSE
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg
ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/seat
Expand All @@ -115,6 +120,14 @@
ME.attach(src)
max_ammo()

/obj/mecha/combat/phazon/vertibird/domove(direction)
if(z != 5)
if(world.time - last_message > 20)
occupant_message("Unable to move while landed.")
last_message = world.time
return 0
. = ..()

///NCR VERTIBIRD

/obj/mecha/combat/phazon/vertibird/ncr
Expand Down Expand Up @@ -155,6 +168,7 @@
zoom_action.Grant(user, src)
eject_action.Grant(user, src)
smoke_action.Grant(user, src)
landing_action.Grant(user, src)
//rotorup_action.Grant(user, src)
//rotordown_action.Grant(user, src)

Expand All @@ -167,6 +181,7 @@
zoom_action.Remove(user)
eject_action.Remove(user)
smoke_action.Remove(user)
landing_action.Grant(user)
//rotorup_action.Remove(user)
//rotordown_action.Remove(user)

Expand Down Expand Up @@ -235,6 +250,7 @@
strafing_action.Grant(user, src)
zoom_action.Grant(user, src)
eject_action.Grant(user, src)
landing_action.Grant(user, src)
//rotorup_action.Grant(user, src)
//rotordown_action.Grant(user, src)

Expand All @@ -246,6 +262,7 @@
strafing_action.Remove(user)
zoom_action.Remove(user)
eject_action.Remove(user)
landing_action.Grant(user)
//rotorup_action.Remove(user)
//rotordown_action.Remove(user)

Expand Down Expand Up @@ -308,6 +325,7 @@
strafing_action.Grant(user, src)
zoom_action.Grant(user, src)
eject_action.Grant(user, src)
landing_action.Grant(user, src)
//rotorup_action.Grant(user, src)
//rotordown_action.Grant(user, src)

Expand All @@ -319,6 +337,7 @@
strafing_action.Remove(user)
zoom_action.Remove(user)
eject_action.Remove(user)
landing_action.Grant(user)
//rotorup_action.Remove(user)
//rotordown_action.Remove(user)

Expand Down
20 changes: 20 additions & 0 deletions code/game/mecha/mecha.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
var/datum/action/innate/mecha/strafe/strafing_action = new
var/datum/action/innate/mecha/klaxon/klaxon_action = new
var/datum/action/innate/mecha/sirens/sirens_action = new
var/datum/action/innate/mecha/Landing/landing_action = new


//Action vars
Expand All @@ -145,6 +146,7 @@

var/occupant_sight_flags = 0 //sight flags to give to the occupant (e.g. mech mining scanner gives meson-like vision)
var/mouse_pointer
var/on_the_air = FALSE

hud_possible = list (DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD, DIAG_TRACK_HUD)

Expand Down Expand Up @@ -1027,6 +1029,24 @@
L.client.change_view(CONFIG_GET(string/default_view))
zoom_mode = 0

/obj/mecha/proc/canZMove(dir, turf/target)
return can_zTravel(target, dir) && (movement_type & FLYING)

/obj/mecha/proc/zMove(dir, feedback = FALSE)
if(dir != UP && dir != DOWN)
return FALSE
var/turf/target = get_step_multiz(src, dir)
if(!target)
if(feedback)
to_chat(src, "<span class='warning'>There's nothing in that direction!</span>")
return FALSE
if(!canZMove(dir, target))
if(feedback)
to_chat(src, "<span class='warning'>You couldn't move there!</span>")
return FALSE
forceMove(target)
return TRUE

/////////////////////////
////// Access stuff /////
/////////////////////////
Expand Down
34 changes: 33 additions & 1 deletion code/game/mecha/mecha_actions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -298,5 +298,37 @@
/datum/action/innate/mecha/sirens/Activate()
playsound(chassis,'sound/f13machines/police.ogg', 50, 1)


/datum/action/innate/mecha/Landing
name = "Land"
button_icon_state = "mech_thrusters_on"

/datum/action/innate/mecha/Landing/Activate()
if(chassis.on_the_air)
var/turf/target = get_step_multiz(chassis, DOWN)
if(!chassis.canZMove(DOWN, target))
chassis.occupant_message("You can't Move in that Direction!")
return
chassis.occupant_message("deploying gear and landing")
if(!do_after(chassis.occupant, 15, target = chassis))
return
chassis.zMove(DOWN, TRUE)
chassis.occupant_message("you hit the ground with the [src]'s rubber tires")
name = "Take Off"
button_icon_state = "mech_thrusters_off"
UpdateButtonIcon()
chassis.on_the_air = FALSE
else
var/turf/target = get_step_multiz(chassis, UP)
if(!chassis.canZMove(UP, target))
chassis.occupant_message("You can't Move in that Direction!")
return
chassis.occupant_message("starting rotors")
if(!do_after(chassis.occupant, 15, target = chassis))
return
chassis.zMove(UP, TRUE)
chassis.occupant_message("taking off!")
name = "Land"
button_icon_state = "mech_thrusters_on"
UpdateButtonIcon()
chassis.on_the_air = TRUE

17 changes: 10 additions & 7 deletions code/game/objects/items/granters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@
/obj/item/book/granter/trait/selection/tribal
name = "Book of Ancient Knowledge"
desc = "A compendium of knowledge passed down from the elders. It looks to be in poor condition."
choices = list("Hit Them With Sticks","Technophilia","Pugilist","Padded Feet","Veteran Table Climber","Basic Surgery","Desert Affinity")
choices = list("Hit Them With Sticks","Technophilia","Pugilist","Nightstalker Ritual","Rite of Resiliance","Basic Surgery","Desert Affinity","Brahmin Shaman")

/obj/item/book/granter/trait/selection/tribal/attack_self(mob/user)
if(!granted_trait)
Expand All @@ -1012,18 +1012,21 @@
if("Pugilist")
granted_trait = TRAIT_IRONFIST
traitname = "using your fists"
if("Padded Feet")
granted_trait = TRAIT_LIGHT_STEP
traitname = "treading carefully"
if("Veteran Table Climber")
granted_trait = TRAIT_FREERUNNING
traitname = "....climbing tables"
if("Nightstalker Ritual")
granted_trait = TRAIT_TOXINLOVER
traitname = "toxin immunity"
if("Rite of Resiliance")
granted_trait = TRAIT_NOLIMBDISABLE
traitname = "endurance"
if("Basic Surgery")
granted_trait = TRAIT_SURGERY_LOW
traitname = "basic surgery"
if("Desert Affinity")
granted_trait = TRAIT_HARD_YARDS
traitname = "trekking"
if("Brahmin Shaman")
granted_trait = TRAIT_CALCIUM_HEALER
traitname = "milk traditions"
return ..()

/obj/item/book/granter/trait/selection/tribal/Initialize()
Expand Down
20 changes: 16 additions & 4 deletions code/modules/mob/mob_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -419,18 +419,31 @@
layer -= MOB_LAYER_SHIFT_INCREMENT
var/layer_priority = (layer - MOB_LAYER) * 100 // Just for text feedback
to_chat(src, span_notice("Your layer priority is now [layer_priority]."))

/mob/verb/up()
set name = "Move Upwards"
set category = "IC"

var/turf/current_turf = get_turf(src)
var/turf/above_turf = SSmapping.get_turf_above(current_turf)

if(!above_turf)
to_chat(src, span_warning("There's nowhere to go in that direction!"))
return
if(can_zFall(above_turf, target = current_turf, direction = DOWN )) //Will we fall down if we go up?
if(buckled)
to_chat(src, span_warning("[buckled] is is not capable of flight."))
else
to_chat(src, span_warning("You are not Superman."))
return

if(zMove(UP, TRUE))
to_chat(src, "<span class='notice'>You move upwards.</span>")
to_chat(src, span_notice("You move upwards."))

/mob/verb/down()
set name = "Move Down"
set category = "IC"

if(zMove(DOWN, TRUE))
to_chat(src, "<span class='notice'>You move down.</span>")

Expand All @@ -449,6 +462,5 @@
forceMove(target)
return TRUE


/mob/proc/canZMove(direction, turf/target)
return FALSE

0 comments on commit d176787

Please sign in to comment.