Refactors rocket launchers, adds it to nukie uplink (#21273)

* initial changes to rocket launcher

* moves the missiles to special projectiles

* gonna keep it real, im too high for mechcode

* missiles are now projectiles

* pt. 2 of last commit

* Now we don't need process fire to handle all this

* shoots you with my gun that makes you explode

* uplink time

* I hate mechs I hate mechs I hate mechs

* minor typo detected

* tech origin fix

* whoops the light ones explode twice

* THIS JUST MAKES IT WORK????

* maybe balance is a good thing

* Renamed ammo in uplink

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* sirryans reviews, ill learn to document someday

* Forcemove time

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

---------

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
BiancaWilkson
2023-06-21 22:39:29 +01:00
committed by GitHub
co-authored by Ryan
parent ce10f4d508
commit e6f8b543ae
5 changed files with 63 additions and 77 deletions
@@ -46,6 +46,14 @@
surplus = 25
uplinktypes = list(UPLINK_TYPE_NUCLEAR, UPLINK_TYPE_SST)
/datum/uplink_item/dangerous/rocket_launcher
name = "Rocket Launcher"
desc = "Not many things can survive a direct hit from this. (Ammunition sold separately, keep away from children.)"
reference = "RL"
item = /obj/item/gun/rocketlauncher
cost = 8
uplinktypes = list(UPLINK_TYPE_NUCLEAR, UPLINK_TYPE_SST)
/datum/uplink_item/dangerous/flamethrower
name = "Flamethrower"
desc = "A flamethrower, fuelled by a portion of highly flammable bio-toxins stolen previously from Nanotrasen stations. Make a statement by roasting the filth in their own greed. Use with caution."
@@ -256,6 +264,14 @@
cost = 4
uplinktypes = list(UPLINK_TYPE_NUCLEAR, UPLINK_TYPE_SST)
/datum/uplink_item/ammo/rocket
name = "Rocket Launcher Shell"
desc = "An extra shell for your RPG. Make sure your bestie isn't standing in front of you."
reference = "HE"
item = /obj/item/ammo_casing/rocket
cost = 6
uplinktypes = list(UPLINK_TYPE_NUCLEAR, UPLINK_TYPE_SST)
/datum/uplink_item/ammo/machinegun
name = "L6 SAW - 5.56x45mm Box Magazine"
desc = "A 50-round magazine of 5.56x45mm ammunition for use in the L6 SAW machine gun. By the time you need to use this, you'll already be on a pile of corpses."
+2 -37
View File
@@ -334,53 +334,18 @@
name = "\improper SRM-8 Light Missile Rack"
icon_state = "mecha_missilerack"
origin_tech = "combat=5;materials=4;engineering=4"
projectile = /obj/item/missile
projectile = /obj/item/projectile/missile/light
fire_sound = 'sound/effects/bang.ogg'
projectiles = 8
projectile_energy_cost = 1000
equip_cooldown = 60
var/missile_speed = 2
var/missile_range = 30
var/heavy_missile = 0
harmful = TRUE
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/action(target, params)
if(!action_checks(target))
return
set_ready_state(0)
var/obj/item/missile/M = new projectile(chassis.loc)
M.primed = 1
if(heavy_missile)
M.heavy_missile = 1
playsound(chassis, fire_sound, 50, 1)
M.throw_at(target, missile_range, missile_speed, spin = FALSE)
projectiles--
log_message("Fired from [name], targeting [target].")
var/turf/T = get_turf(src)
add_attack_logs(chassis.occupant, target, "fired a [src]", ATKLOG_FEW)
log_game("[key_name(chassis.occupant)] fired a [src] in [T.x], [T.y], [T.z]")
do_after_cooldown()
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/heavy
name = "\improper SRX-13 Heavy Missile Launcher"
heavy_missile = 1
/obj/item/missile
icon = 'icons/obj/grenade.dmi'
icon_state = "missile"
var/primed = null
var/heavy_missile = 0
throwforce = 15
/obj/item/missile/throw_impact(atom/hit_atom)
if(primed)
if(heavy_missile)
explosion(hit_atom, 2, 3, 4, 6, 0)
else
explosion(hit_atom, 0, 0, 2, 4, 0)
qdel(src)
else
..()
projectile = /obj/item/projectile/missile
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang
name = "\improper SGL-6 Flashbang Launcher"
@@ -326,7 +326,7 @@
name = "rocket shell"
desc = "A high explosive designed to be fired from a launcher."
icon_state = "rocketshell"
projectile_type = /obj/item/missile
projectile_type = /obj/item/projectile/missile
caliber = "rocket"
muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_STRONG
muzzle_flash_range = MUZZLE_FLASH_RANGE_STRONG
+22 -36
View File
@@ -1,55 +1,41 @@
/obj/item/gun/rocketlauncher
var/projectile
name = "rocket launcher"
desc = "Say hello to my little friend"
desc = "A rocket propelled grenade launcher. Holds one shell at a time."
icon_state = "rocket"
item_state = "rocket"
w_class = WEIGHT_CLASS_BULKY
throw_speed = 2
throw_range = 10
force = 5.0
throw_range = 3
force = 15
flags = CONDUCT
origin_tech = "combat=6"
origin_tech = "combat=6;syndicate=7"
fire_sound = 'sound/weapons/blastcannon.ogg'
fire_delay = 40
recoil = 2
zoomable = TRUE
zoom_amt = 7
var/missile_speed = 2
var/missile_range = 30
var/max_rockets = 1
var/list/rockets = new/list()
/obj/item/gun/rocketlauncher/examine(mob/user)
. = ..()
. += "<span class='notice'>[rockets.len] / [max_rockets] rockets.</span>"
. += "<span class='notice'>It is currently [chambered ? "" : "un"]loaded.</span>"
/obj/item/gun/rocketlauncher/Destroy()
QDEL_LIST_CONTENTS(rockets)
rockets = null
return ..()
/obj/item/gun/rocketlauncher/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/ammo_casing/rocket))
if(rockets.len < max_rockets)
user.drop_item()
I.loc = src
rockets += I
to_chat(user, "<span class='notice'>You put the rocket in [src].</span>")
to_chat(user, "<span class='notice'>[rockets.len] / [max_rockets] rockets.</span>")
else
to_chat(user, "<span class='notice'>[src] cannot hold more rockets.</span>")
else
if(!istype(I, /obj/item/ammo_casing/rocket))
return ..()
if(!chambered)
user.unEquip(I)
I.forceMove(src)
chambered = I
to_chat(user, "<span class='notice'>You put the rocket in [src].</span>")
else
to_chat(user, "<span class='notice'>[src] cannot hold another rocket.</span>")
/obj/item/gun/rocketlauncher/process_chamber()
QDEL_NULL(chambered)
/obj/item/gun/rocketlauncher/can_shoot()
return rockets.len
/obj/item/gun/rocketlauncher/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override = "")
if(rockets.len)
var/obj/item/ammo_casing/rocket/I = rockets[1]
var/obj/item/missile/M = new /obj/item/missile(user.loc)
playsound(user.loc, 'sound/effects/bang.ogg', 50, 1)
M.primed = 1
M.throw_at(target, missile_range, missile_speed, user, 1)
message_admins("[key_name_admin(user)] fired a rocket from a rocket launcher ([name]).")
log_game("[key_name_admin(user)] used a rocket launcher ([name]).")
rockets -= I
qdel(I)
else
to_chat(user, "<span class='warning'>[src] is empty.</span>")
return chambered
@@ -13,7 +13,7 @@
/obj/item/projectile/ion/on_hit(atom/target, blocked = 0)
..()
empulse(target, strong_emp, weak_emp, TRUE, cause = "[type] fired by [key_name(firer)]")
return 1
return TRUE
/obj/item/projectile/ion/weak
strong_emp = 0
@@ -29,7 +29,7 @@
/obj/item/projectile/bullet/gyro/on_hit(atom/target, blocked = 0)
..()
explosion(target, -1, 0, 2, cause = "[type] fired by [key_name(firer)]")
return 1
return TRUE
/obj/item/projectile/bullet/a40mm
name ="40mm grenade"
@@ -42,7 +42,7 @@
/obj/item/projectile/bullet/a40mm/on_hit(atom/target, blocked = 0)
..()
explosion(target, -1, 0, 2, 1, 0, flame_range = 3, cause = "[type] fired by [key_name(firer)]")
return 1
return TRUE
/obj/item/projectile/temp
name = "temperature beam"
@@ -123,6 +123,25 @@
shake_camera(M, 3, 1)
qdel(src)
/obj/item/projectile/missile
icon = 'icons/obj/grenade.dmi'
icon_state = "missile"
damage = 50
///If the missile will have a heavy, or light explosion.
var/heavy = TRUE
/obj/item/projectile/missile/on_hit(atom/target, blocked, hit_zone)
..()
if(heavy)
explosion(target, 1, 2, 3, cause = "[type] fired by [key_name(firer)]")
else
explosion(target, -1, 0, 2, cause = "[type] fired by [key_name(firer)]")
return TRUE
/obj/item/projectile/missile/light
damage = 15
heavy = FALSE
/obj/item/projectile/energy/floramut
name = "alpha somatoray"
icon_state = "energy"