Skip to content

Commit

Permalink
Merge pull request Civ13#2580 from HaultyAnonie/rpg4
Browse files Browse the repository at this point in the history
adds used/unused to single_shot launchers instead of unloaded/loaded
  • Loading branch information
savethetreez authored Jan 23, 2024
2 parents 694a42c + 71bd7d8 commit 0af8275
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions code/modules/1713/weapons/guns/rocket.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,15 @@
load_delay = 18

/obj/item/weapon/gun/launcher/rocket/examine(mob/user)
..()
if (max_rockets > 1)
to_chat(user, SPAN_NOTICE("<b>LOADED [rockets.len]/[max_rockets]</B>"))
else
if (rockets.len)
to_chat(user, SPAN_NOTICE("<b>LOADED</B>"))
else
to_chat(user, SPAN_NOTICE("<b>UNLOADED</B>"))
..()
if (!istype(src, /obj/item/weapon/gun/launcher/rocket/single_shot)) // Check if not single_shot or its subtypes
if (max_rockets > 1)
to_chat(user, SPAN_NOTICE("<b>LOADED [rockets.len]/[max_rockets]</B>"))
else
if (rockets.len)
to_chat(user, SPAN_NOTICE("<b>LOADED</B>"))
else
to_chat(user, SPAN_NOTICE("<b>UNLOADED</B>"))

/obj/item/weapon/gun/launcher/rocket/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/ammo_casing/rocket))
Expand Down Expand Up @@ -383,6 +384,7 @@
release_force = 12
firing_range = 10
var/rocket_path
var/is_used = FALSE

/obj/item/weapon/gun/launcher/rocket/single_shot/New()
..()
Expand Down Expand Up @@ -412,6 +414,19 @@
/obj/item/weapon/gun/launcher/rocket/single_shot/attack_hand(mob/user)
..()

/obj/item/weapon/gun/launcher/rocket/single_shot/handle_post_fire(mob/user, atom/target)
..()
is_used = TRUE
update_icon()

/obj/item/weapon/gun/launcher/rocket/single_shot/examine(mob/user)
..()
if (is_used)
to_chat(user, SPAN_NOTICE("<b>USED</B>"))
else
to_chat(user, SPAN_NOTICE("<b>UNUSED</B>"))


/obj/item/weapon/gun/launcher/rocket/single_shot/panzerfaust
name = "Panzerfaust 60"
desc = "German single-use rocket."
Expand Down

0 comments on commit 0af8275

Please sign in to comment.