mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: CHOMPStation2 <chompsation2@gmail.com> Co-authored-by: Raeschen <rycoop29@gmail.com> Co-authored-by: Changelogs <action@github.com> Co-authored-by: Aroliacue <96730930+Aroliacue@users.noreply.github.com> Co-authored-by: Eli <fracshun@gmail.com> Co-authored-by: tacoguy7765093 <karokaromaro@gmail.com> Co-authored-by: Nadyr <41974248+Darlantanis@users.noreply.github.com> Co-authored-by: TheGreatKitsune <88862343+TheGreatKitsune@users.noreply.github.com> Co-authored-by: Missile597 <150307788+Missile597@users.noreply.github.com>
46 lines
1.4 KiB
Plaintext
46 lines
1.4 KiB
Plaintext
/obj/item/weapon/gun/launcher/rocket
|
|
name = "rocket launcher"
|
|
desc = "MAGGOT."
|
|
icon_state = "rocket"
|
|
item_state = "rocket"
|
|
w_class = ITEMSIZE_HUGE //CHOMP Edit.
|
|
throw_speed = 2
|
|
throw_range = 10
|
|
force = 5.0
|
|
slot_flags = 0
|
|
origin_tech = list(TECH_COMBAT = 8, TECH_MATERIAL = 5)
|
|
fire_sound = 'sound/weapons/rpg.ogg'
|
|
|
|
release_force = 15
|
|
throw_distance = 30
|
|
var/max_rockets = 1
|
|
var/list/rockets = new/list()
|
|
|
|
/obj/item/weapon/gun/launcher/rocket/examine(mob/user)
|
|
. = ..()
|
|
if(get_dist(user, src) <= 2)
|
|
. += span_blue("[rockets.len] / [max_rockets] rockets.")
|
|
|
|
/obj/item/weapon/gun/launcher/rocket/attackby(obj/item/I as obj, mob/user as mob)
|
|
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_blue("You put the rocket in [src]."))
|
|
to_chat(user, span_blue("[rockets.len] / [max_rockets] rockets."))
|
|
else
|
|
to_chat(usr, span_red(">[src] cannot hold more rockets."))
|
|
|
|
/obj/item/weapon/gun/launcher/rocket/consume_next_projectile()
|
|
if(rockets.len)
|
|
var/obj/item/ammo_casing/rocket/I = rockets[1]
|
|
rockets -= I
|
|
return new I.projectile_type(src)
|
|
return null
|
|
|
|
/obj/item/weapon/gun/launcher/rocket/handle_post_fire(mob/user, atom/target)
|
|
message_admins("[key_name_admin(user)] fired a rocket from a rocket launcher ([src.name]) at [target].")
|
|
log_game("[key_name_admin(user)] used a rocket launcher ([src.name]) at [target].")
|
|
..()
|