Skip to content

Commit

Permalink
One Shot RPG (#3433)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
Adds a one-shot rocket launcher to the code. Adjusts the code in some
places to support it being truly one shot. Also adds being able to draw
on rocket launchers for mild entertainment.
Rye did the sprite.
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
A disposable anti-armor tool is good for people who are poor and or
frontiersmen.
<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog
Rye, Erika 
:cl:
add: One-Shot Rocket Launcher. A quick solution to an armored problem. 
add: You can now scribble profane things onto the tube of your rocket
launcher. Use this power wisely.
imageadd: Rye: A sprite for a one-shot rocket launcher
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
Erikafox authored Oct 1, 2024
1 parent ea15b40 commit bb2ab55
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 4 deletions.
3 changes: 3 additions & 0 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
var/casing_ejector = TRUE
///Whether the gun has an internal magazine or a detatchable one. Overridden by BOLT_TYPE_NO_BOLT.
var/internal_magazine = FALSE
///Whether the gun *can* be reloaded
var/sealed_magazine = FALSE


///Phrasing of the magazine in examine and notification messages; ex: magazine, box, etx
var/magazine_wording = "magazine"
Expand Down
3 changes: 3 additions & 0 deletions code/modules/projectiles/guns/ballistic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
. = ..()
if (.)
return
if(sealed_magazine)
to_chat(user, span_warning("The magazine on [src] is sealed and cannot be reloaded!"))
return
if (!internal_magazine && istype(A, /obj/item/ammo_box/magazine))
var/obj/item/ammo_box/magazine/AM = A
if (!magazine)
Expand Down
50 changes: 46 additions & 4 deletions code/modules/projectiles/guns/ballistic/launchers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,69 @@
actions_types = list()
casing_ejector = FALSE

GLOBAL_LIST_INIT(rpg_scrawlings, list(
"\"FRONT TOWARDS ENEMY\"",
"\"MY WIFE LEFT ME\"",
"A Kepori inset in a stylized crimson heart",
"\"Eat lead psychohazard!\"",
"\"Portable Demotion\"",
"A drawing of the Rilena character 'T4L1' smoking a boof",
"\"Eat it corpo!\"",
"A Sarathi woman in a suggestive pose",
"\"Arm this!\""
))


/obj/item/gun/ballistic/rocketlauncher
name = "\improper PML-9"
desc = "A reusable rocket-propelled grenade launcher. The words \"NT this way\" and an arrow have been written near the barrel."
desc = "A reusable rocket-propelled grenade launcher."

icon_state = "rocketlauncher"
item_state = "rocketlauncher"
mag_type = /obj/item/ammo_box/magazine/internal/rocketlauncher
fire_sound = 'sound/weapons/gun/general/rocket_launch.ogg'
load_sound = 'sound/weapons/gun/general/rocket_load.ogg'
w_class = WEIGHT_CLASS_BULKY
gun_firemodes = list(FIREMODE_SEMIAUTO)
burst_size = 1
fire_delay = 0.4 SECONDS
casing_ejector = FALSE

weapon_weight = WEAPON_HEAVY
w_class = WEIGHT_CLASS_BULKY

//Bolt
bolt_type = BOLT_TYPE_NO_BOLT
internal_magazine = TRUE

///Magazine stuff
cartridge_wording = "rocket"
internal_magazine = TRUE
empty_indicator = TRUE
tac_reloads = FALSE
casing_ejector = FALSE

manufacturer = MANUFACTURER_SCARBOROUGH

attack_verb = list("bludgeoned", "hit", "slammed", "whacked")

valid_attachments = list()
slot_available = list()

var/rpg_scribble = null

/obj/item/gun/ballistic/rocketlauncher/Initialize()
. = ..()
rpg_scribble = pick(GLOB.rpg_scrawlings)
desc += " [rpg_scribble] is scrawled on the tube"

/obj/item/gun/ballistic/rocketlauncher/attackby(obj/item/A, mob/user, params)
. = ..()
if(istype(A, /obj/item/pen))
rpg_scribble = stripped_input(user, "What are you putting on [src]?", "Rocket Launcher Doodle")
if(!rpg_scribble || !length(rpg_scribble))
desc = "[src::desc]"
return
desc = "[src::desc] [rpg_scribble] is scribbled on the body."


/obj/item/gun/ballistic/rocketlauncher/afterattack()
. = ..()
magazine.get_round(FALSE) //Hack to clear the mag after it's fired
Expand All @@ -80,6 +119,9 @@
righthand_file = 'icons/obj/guns/manufacturer/solararmories/righthand.dmi'
mob_overlay_icon = 'icons/obj/guns/manufacturer/solararmories/onmob.dmi'

//recoiless rifles use shells
cartridge_wording = "shell"

icon_state = "panzerfaust"
item_state = "panzerfaust"
manufacturer = MANUFACTURER_SOLARARMORIES
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,45 @@
caliber = "12ga"
max_ammo = 40
w_class = WEIGHT_CLASS_NORMAL


/obj/item/gun/ballistic/rocketlauncher/oneshot
name = "\improper Hammer"
desc = "A disposable rocket-propelled grenade launcher loaded with a HEDP shell."

icon = 'icons/obj/guns/manufacturer/frontier_import/48x32.dmi'
lefthand_file = 'icons/obj/guns/manufacturer/frontier_import/lefthand.dmi'
righthand_file = 'icons/obj/guns/manufacturer/frontier_import/righthand.dmi'
mob_overlay_icon = 'icons/obj/guns/manufacturer/frontier_import/onmob.dmi'
base_icon_state = "rpg"
icon_state = "rpg"
item_state = "rpg"

mag_type = /obj/item/ammo_box/magazine/internal/rocketlauncher/oneshot
fire_sound = 'sound/weapons/gun/general/rocket_launch.ogg'
load_sound = 'sound/weapons/gun/general/rocket_load.ogg'
weapon_weight = WEAPON_HEAVY
bolt_type = BOLT_TYPE_NO_BOLT

cartridge_wording = "rocket"
empty_indicator = FALSE
sealed_magazine = TRUE
manufacturer = MANUFACTURER_IMPORT
slot_flags = ITEM_SLOT_BACK


/obj/item/gun/ballistic/rocketlauncher/oneshot/Initialize()
. = ..()
if(prob(1))
name = "\improper Mallet"

/obj/item/gun/ballistic/rocketlauncher/oneshot/examine(mob/user)
. = ..()
if(!chambered)
. += span_warning("It has been spent, and is now useless.")

/obj/item/ammo_box/magazine/internal/rocketlauncher/oneshot
name = "oneshot rocket launcher magazine"
ammo_type = /obj/item/ammo_casing/caseless/rocket/hedp
caliber = "84mm"
max_ammo = 1
Binary file modified icons/obj/guns/manufacturer/frontier_import/48x32.dmi
Binary file not shown.
Binary file modified icons/obj/guns/manufacturer/frontier_import/lefthand.dmi
Binary file not shown.
Binary file modified icons/obj/guns/manufacturer/frontier_import/onmob.dmi
Binary file not shown.
Binary file modified icons/obj/guns/manufacturer/frontier_import/righthand.dmi
Binary file not shown.

0 comments on commit bb2ab55

Please sign in to comment.