Files
Sharkmare ac891839cb Code for a Chaos Size Gun
An `advanced` size gun, the dial and screws are a bit loose tho.
Might've been modded slightly by less than trustworthy people, 
But hey at least it no longer uses as much power per shot!
2019-04-09 14:00:19 +02:00

135 lines
3.8 KiB
Plaintext

//
// Size Gun
//
/obj/item/weapon/gun/energy/sizegun
name = "size gun" //I have no idea why this was called shrink ray when this increased and decreased size.
desc = "A highly advanced ray gun with a knob on the side to adjust the size you desire. Warning: Do not insert into mouth."
icon = 'icons/obj/gun_vr.dmi'
icon_state = "sizegun-shrink100" // Someone can probably do better. -Ace
item_state = null //so the human update icon uses the icon_state instead
fire_sound = 'sound/weapons/wave.ogg'
charge_cost = 240
projectile_type = /obj/item/projectile/beam/sizelaser
origin_tech = list(TECH_BLUESPACE = 4)
modifystate = "sizegun-shrink"
battery_lock = 1
var/size_set_to = 1
firemodes = list(
list(mode_name = "select size",
projectile_type = /obj/item/projectile/beam/sizelaser,
modifystate = "sizegun-grow",
fire_sound = 'sound/weapons/pulse3.ogg'
))
/obj/item/weapon/gun/energy/sizegun/New()
..()
verbs += /obj/item/weapon/gun/energy/sizegun/proc/select_size
/obj/item/weapon/gun/energy/sizegun/attack_self(mob/user)
. = ..()
select_size()
/obj/item/weapon/gun/energy/sizegun/consume_next_projectile()
. = ..()
var/obj/item/projectile/beam/sizelaser/G = .
if(istype(G))
G.set_size = size_set_to
/obj/item/weapon/gun/energy/sizegun/proc/select_size()
set name = "Select Size"
set category = "Object"
set src in view(1)
var/size_select = input("Put the desired size (25-200%)", "Set Size", size_set_to*100) as num
if(size_select>200 || size_select<25)
usr << "<span class='notice'>Invalid size.</span>"
return
size_set_to = (size_select/100)
usr << "<span class='notice'>You set the size to [size_select]%</span>"
/obj/item/weapon/gun/energy/sizegun/examine(mob/user)
..()
var/size_examine = (size_set_to*100)
user << "<span class='info'>It is currently set at [size_examine]%</span>"
//
// Beams for size gun
//
/obj/item/projectile/beam/sizelaser
name = "size beam"
icon_state = "xray"
nodamage = 1
damage = 0
check_armour = "laser"
var/set_size = 1 //Let's default to 100%
muzzle_type = /obj/effect/projectile/xray/muzzle
tracer_type = /obj/effect/projectile/xray/tracer
impact_type = /obj/effect/projectile/xray/impact
on_hit(var/atom/target)
var/mob/living/M = target
if(ishuman(target))
var/mob/living/carbon/human/H = M
H.resize(set_size)
H.show_message("<font color='#6F6FE2'> The beam fires into your body, changing your size!</font>")
H.updateicon()
else if (istype(target, /mob/living/))
var/mob/living/H = M
H.resize(set_size)
H.updateicon()
else
return 1
//CHOMP ADDITIONS.//Anything below here.
//
//BADvanced size gun
//
/obj/item/weapon/gun/energy/sizegun/not_advanced
name = "Corrupted size gun"
desc = "A highly advanced ray gun with a knob on the side to adjust the size you desire. Or at least that's what it used to be."
projectile_type = /obj/item/projectile/beam/sizelaser/chaos
charge_cost = 60 //1/3 of the base price for a normal one.
//
//CHAOS laser
//
/obj/item/projectile/beam/sizelaser/chaos //The Defintiely not advanced sizeguns laser.
name = "chaos size beam"
light_color = "#FF0000"
light_range = 3
light_power = 9 //should be plenty visible.
var/list/chaos_colors = list(
"#FF0000",
"#00FF00",
"#0000FF",
"#FFFF00",
"#00FFFF",
"#FF00FF",
"#000000",
"#FFFFFF",
"#F0F0F0",
"#0F0F0F",
)
on_hit(var/atom/target)
light_color = pick(chaos_colors)
var/chaos = rand(25,200)
var/mob/living/M = target
if(ishuman(target))
var/mob/living/carbon/human/H = M
H.resize(chaos/100)
H.show_message("<font color='#6F6FE2'> The beam fires into your body, changing your size!</font>")
H.updateicon()
else if (istype(target, /mob/living/))
var/mob/living/H = M
H.resize(chaos/100)
H.updateicon()
else
return 1