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

Add visual sprite display of ammo count for dropships, add toggle to auto deploy to sentries/MGs on landing, dropship fabricator build queue #7084

Merged
merged 21 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
17 changes: 17 additions & 0 deletions code/game/machinery/computer/dropship_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,23 @@
SEND_SIGNAL(src, COMSIG_CAMERA_SET_AREA, defense.range_bounds, defense.loc.z)
return TRUE

if("auto-deploy")
var/equipment_tag = params["equipment_id"]
for(var/obj/structure/dropship_equipment/equipment as anything in shuttle.equipments)
var/mount_point = equipment.ship_base.attach_id
if(mount_point != equipment_tag)
continue

if(istype(equipment, /obj/structure/dropship_equipment/sentry_holder))
var/obj/structure/dropship_equipment/sentry_holder/sentry = equipment
sentry.auto_deploy = !sentry.auto_deploy
return TRUE

if(istype(equipment, /obj/structure/dropship_equipment/mg_holder))
var/obj/structure/dropship_equipment/mg_holder/mg = equipment
mg.auto_deploy = !mg.auto_deploy
return TRUE

if("clear-camera")
set_camera_target(null)
return TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/sentry_holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
density = FALSE
anchored = TRUE
unacidable = 1
icon = 'icons/obj/structures/props/almayer_props.dmi'
icon = 'icons/obj/structures/props/dropship_equipment.dmi'
icon_state = "sentry_system_installed"
active_power_usage = 5000
idle_power_usage = 1000
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/effects/rappel_rope.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/obj/effect/rappel_rope
name = "rope"
icon = 'icons/obj/structures/props/almayer_props.dmi'
icon = 'icons/obj/structures/props/dropship_equipment.dmi'
icon_state = "rope"
layer = ABOVE_LYING_MOB_LAYER
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/props.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@
/obj/structure/prop/invuln/rope
name = "rope"
desc = "A secure rope looks like someone might've been hiding out on those rocks."
icon = 'icons/obj/structures/props/almayer_props.dmi'
icon = 'icons/obj/structures/props/dropship_equipment.dmi'
icon_state = "rope"
density = FALSE

Expand Down
3 changes: 1 addition & 2 deletions code/modules/almayer/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,9 @@
/obj/structure/prop/almayer/minigun_crate
name = "30mm ammo crate"
desc = "A crate full of 30mm bullets used on one of the weapon pod types for the dropship. Moving this will require some sort of lifter."
icon = 'icons/obj/structures/props/almayer_props.dmi'
icon = 'icons/obj/structures/props/dropship_ammo.dmi'
icon_state = "30mm_crate"


/obj/structure/prop/almayer/computers
var/hacked = FALSE

Expand Down
21 changes: 12 additions & 9 deletions code/modules/cm_marines/dropship_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/// Dropship weaponry ammunition
/obj/structure/ship_ammo
icon = 'icons/obj/structures/props/almayer_props.dmi'
icon = 'icons/obj/structures/props/dropship_ammo.dmi'
density = TRUE
anchored = TRUE
throwpass = TRUE
Expand Down Expand Up @@ -39,6 +39,15 @@
var/mob/source_mob
var/combat_equipment = TRUE

/obj/structure/ship_ammo/update_icon()
. = ..()

var/ammo_stage = ammo_count / ammo_used_per_firing
icon_state = "[initial(icon_state)]_[ammo_stage]"

if (ammo_count == max_ammo_count)
icon_state = initial(icon_state)

/obj/structure/ship_ammo/attack_alien(mob/living/carbon/xenomorph/current_xenomorph)
if(unslashable)
return XENO_NO_DELAY_ACTION
Expand Down Expand Up @@ -215,7 +224,6 @@
travelling_time = 10
ammo_count = 100
max_ammo_count = 100
ammo_used_per_firing = 40
equipment_type = /obj/structure/dropship_equipment/weapon/laser_beam_gun
ammo_name = "charge"
transferable_ammo = TRUE
Expand Down Expand Up @@ -257,7 +265,7 @@
/obj/structure/ship_ammo/rocket
name = "abstract rocket"
icon_state = "single"
icon = 'icons/obj/structures/props/almayer_props64.dmi'
icon = 'icons/obj/structures/props/dropship_ammo64.dmi'
equipment_type = /obj/structure/dropship_equipment/weapon/rocket_pod
ammo_count = 1
max_ammo_count = 1
Expand All @@ -268,11 +276,11 @@
travelling_time = 60 //faster than 30mm rounds
max_inaccuracy = 5
point_cost = 0
fire_mission_delay = 4

/obj/structure/ship_ammo/rocket/detonate_on(turf/impact, obj/structure/dropship_equipment/weapon/fired_from)
qdel(src)


//this one is air-to-air only
/obj/structure/ship_ammo/rocket/widowmaker
name = "\improper AIM-224B 'Widowmaker'"
Expand All @@ -281,7 +289,6 @@
travelling_time = 30 //not powerful, but reaches target fast
ammo_id = ""
point_cost = 300
fire_mission_delay = 4 //We don't care because our ammo has just 1 rocket

/obj/structure/ship_ammo/rocket/widowmaker/detonate_on(turf/impact, obj/structure/dropship_equipment/weapon/fired_from)
impact.ceiling_debris_check(3)
Expand All @@ -294,7 +301,6 @@
icon_state = "banshee"
ammo_id = "b"
point_cost = 300
fire_mission_delay = 4 //We don't care because our ammo has just 1 rocket

/obj/structure/ship_ammo/rocket/banshee/detonate_on(turf/impact, obj/structure/dropship_equipment/weapon/fired_from)
impact.ceiling_debris_check(3)
Expand All @@ -309,7 +315,6 @@
travelling_time = 20 //A fast payload due to its very tight blast zone
ammo_id = "k"
point_cost = 300
fire_mission_delay = 4 //We don't care because our ammo has just 1 rocket

/obj/structure/ship_ammo/rocket/keeper/detonate_on(turf/impact, obj/structure/dropship_equipment/weapon/fired_from)
impact.ceiling_debris_check(3)
Expand Down Expand Up @@ -351,7 +356,6 @@
ammo_id = "f"
travelling_time = 50
point_cost = 300
fire_mission_delay = 4

/obj/structure/ship_ammo/rocket/thermobaric/detonate_on(turf/impact, obj/structure/dropship_equipment/weapon/fired_from)
impact.ceiling_debris_check(3)
Expand All @@ -367,7 +371,6 @@
name = "\improper AGR-59 'Mini-Mike'"
desc = "The AGR-59 'Mini-Mike' minirocket is a cheap and efficient means of putting hate down range. Though rockets lack a guidance package, it makes up for it in ammunition count. Can be loaded into the LAU-229 Rocket Pod."
icon_state = "minirocket"
icon = 'icons/obj/structures/props/almayer_props.dmi'
equipment_type = /obj/structure/dropship_equipment/weapon/minirocket_pod
ammo_count = 6
max_ammo_count = 6
Expand Down
30 changes: 22 additions & 8 deletions code/modules/cm_marines/dropship_equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/obj/structure/dropship_equipment
density = TRUE
anchored = TRUE
icon = 'icons/obj/structures/props/almayer_props.dmi'
icon = 'icons/obj/structures/props/dropship_equipment.dmi'
climbable = TRUE
layer = ABOVE_OBJ_LAYER //so they always appear above attach points when installed
var/shorthand
Expand Down Expand Up @@ -168,6 +168,7 @@
var/deployment_cooldown
var/obj/structure/machinery/defenses/sentry/premade/dropship/deployed_turret
combat_equipment = FALSE
var/auto_deploy = FALSE // allows dropship turrets to be auto deployed, a toggle

/obj/structure/dropship_equipment/sentry_holder/Initialize()
. = ..()
Expand Down Expand Up @@ -196,6 +197,7 @@
.["health"] = defense.health
.["health_max"] = defense.health_max
.["deployed"] = is_deployed
.["auto_deploy"] = auto_deploy

if(istype(defense, /obj/structure/machinery/defenses/sentry))
var/obj/structure/machinery/defenses/sentry/sentrygun = defense
Expand All @@ -207,6 +209,10 @@
if(ship_base && ship_base.base_category == DROPSHIP_WEAPON) //only external sentires are automatically undeployed
undeploy_sentry()

/obj/structure/dropship_equipment/sentry_holder/on_arrival()
if(ship_base && auto_deploy && ship_base.base_category == DROPSHIP_WEAPON) //only external sentires are automatically deployed
deploy_sentry()

/obj/structure/dropship_equipment/sentry_holder/equipment_interact(mob/user)
if(deployed_turret)
if(deployment_cooldown > world.time)
Expand Down Expand Up @@ -323,6 +329,7 @@
var/deployment_cooldown
var/obj/structure/machinery/m56d_hmg/mg_turret/dropship/deployed_mg
combat_equipment = FALSE
var/auto_deploy = FALSE

/obj/structure/dropship_equipment/mg_holder/Initialize()
. = ..()
Expand All @@ -344,6 +351,7 @@
.["rounds"] = deployed_mg.rounds
.["max_rounds"] = deployed_mg.rounds_max
.["deployed"] = is_deployed
.["auto_deploy"] = auto_deploy

/obj/structure/dropship_equipment/mg_holder/get_examine_text(mob/user)
. = ..()
Expand All @@ -354,6 +362,10 @@
if(ship_base && ship_base.base_category == DROPSHIP_WEAPON) //only external mgs are automatically undeployed
undeploy_mg()

/obj/structure/dropship_equipment/mg_holder/on_arrival()
if(ship_base && auto_deploy && ship_base.base_category == DROPSHIP_WEAPON) //only external mgs are automatically deployed
deploy_mg(null)

/obj/structure/dropship_equipment/mg_holder/attack_hand(user as mob)
if(ship_base)
if(deployed_mg)
Expand Down Expand Up @@ -449,7 +461,7 @@
//================= FUEL EQUIPMENT =================//

/obj/structure/dropship_equipment/fuel
icon = 'icons/obj/structures/props/almayer_props64.dmi'
icon = 'icons/obj/structures/props/dropship_equipment64.dmi'
equip_categories = list(DROPSHIP_FUEL_EQP)


Expand Down Expand Up @@ -498,7 +510,7 @@
is_interactable = TRUE
point_cost = 50
var/spotlights_cooldown
var/brightness = 11
var/brightness = 14

/obj/structure/dropship_equipment/electronics/spotlights/equipment_interact(mob/user)
if(spotlights_cooldown > world.time)
Expand Down Expand Up @@ -614,7 +626,7 @@
/// CAS Dropship weaponry, used for aerial bombardment
/obj/structure/dropship_equipment/weapon
name = "abstract weapon"
icon = 'icons/obj/structures/props/almayer_props64.dmi'
icon = 'icons/obj/structures/props/dropship_equipment64.dmi'
equip_categories = list(DROPSHIP_WEAPON)
bound_width = 32
bound_height = 64
Expand Down Expand Up @@ -772,15 +784,18 @@
name = "\improper LAU-229 Rocket Pod"
icon_state = "minirocket_pod"
desc = "A rocket pod capable of launching six laser-guided mini rockets. Moving this will require some sort of lifter. Accepts the AGR-59 series of minirockets."
icon = 'icons/obj/structures/props/almayer_props64.dmi'
firing_sound = 'sound/effects/rocketpod_fire.ogg'
firing_delay = 10 //1 seconds
point_cost = 600
shorthand = "RKT"

/obj/structure/dropship_equipment/weapon/minirocket_pod/update_icon()
if(ammo_equipped && ammo_equipped.ammo_count)
icon_state = "minirocket_pod_loaded"
var/ammo_stage = ammo_equipped.ammo_count / ammo_equipped.ammo_used_per_firing
icon_state = "[initial(icon_state)]_loaded_[ammo_stage]"

if (ammo_equipped.ammo_count == ammo_equipped.max_ammo_count)
icon_state = "[initial(icon_state)]_loaded"
else
if(ship_base) icon_state = "minirocket_pod_installed"
else icon_state = "minirocket_pod"
Expand All @@ -794,7 +809,6 @@
name = "\improper LWU-6B Laser Cannon"
icon_state = "laser_beam"
desc = "State of the art technology recently acquired by the USCM, it fires a battery-fed pulsed laser beam at near lightspeed setting on fire everything it touches. Moving this will require some sort of lifter. Accepts the BTU-17/LW Hi-Cap Laser Batteries."
icon = 'icons/obj/structures/props/almayer_props64.dmi'
firing_sound = 'sound/effects/phasein.ogg'
firing_delay = 50 //5 seconds
point_cost = 500
Expand All @@ -813,7 +827,7 @@
name = "\improper LAG-14 Internal Sentry Launcher"
icon_state = "launch_bay"
desc = "A launch bay to drop special ordnance. Fits inside the dropship's crew weapon emplacement. Moving this will require some sort of lifter. Accepts the A/C-49-P Air Deployable Sentry as ammunition."
icon = 'icons/obj/structures/props/almayer_props.dmi'
icon = 'icons/obj/structures/props/dropship_equipment.dmi'
firing_sound = 'sound/weapons/gun_flare_explode.ogg'
firing_delay = 10 //1 seconds
bound_height = 32
Expand Down
Loading
Loading