mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-21 15:42:53 +00:00
The next type of mimic is for the staff of animation! They will copy the icon of the object they're copying and will set themselves stats based on the object too. They will not attack the bearer of the staff which made them animated. Added the option to get the staff on the wizard's spell book. Added a "friends" var to hostile mobs. It will make the simple animal ignore friends when choosing targets. Changed the statues from /obj/effect/showcase to /obj/structure/showcase. Added a new variable to projectiles, "shot_from" is the gun that shot the projectile. It's used to determine what staff animated the mob and it will then add that staff, so it can ignore it when choosing targets. Added a wander var for simple animals, turning it to 0 will stop the simple animal from moving when idle. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5246 316c924e-a436-60f5-8080-3fe189b3f50e
133 lines
3.3 KiB
Plaintext
133 lines
3.3 KiB
Plaintext
/obj/item/weapon/gun
|
|
name = "gun"
|
|
desc = "Its a gun. It's pretty terrible, though."
|
|
icon = 'icons/obj/gun.dmi'
|
|
icon_state = "detective"
|
|
item_state = "gun"
|
|
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
|
|
slot_flags = SLOT_BELT
|
|
m_amt = 2000
|
|
w_class = 3.0
|
|
throwforce = 5
|
|
throw_speed = 4
|
|
throw_range = 5
|
|
force = 5.0
|
|
origin_tech = "combat=1"
|
|
attack_verb = list("struck", "hit", "bashed")
|
|
|
|
var/fire_sound = 'sound/weapons/Gunshot.ogg'
|
|
var/obj/item/projectile/in_chamber = null
|
|
var/caliber = ""
|
|
var/silenced = 0
|
|
var/recoil = 0
|
|
var/ejectshell = 1
|
|
var/clumsy_check = 1
|
|
|
|
|
|
proc/load_into_chamber()
|
|
return
|
|
|
|
proc/special_check(var/mob/M)
|
|
return
|
|
|
|
|
|
load_into_chamber()
|
|
return 0
|
|
|
|
|
|
special_check(var/mob/M) //Placeholder for any special checks, like detective's revolver.
|
|
return 1
|
|
|
|
|
|
emp_act(severity)
|
|
for(var/obj/O in contents)
|
|
O.emp_act(severity)
|
|
|
|
|
|
afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, flag, params)//TODO: go over this
|
|
if(flag) return //we're placing gun on a table or in backpack
|
|
if(istype(target, /obj/machinery/recharger) && istype(src, /obj/item/weapon/gun/energy)) return//Shouldnt flag take care of this?
|
|
|
|
//Exclude lasertag guns from the CLUMSY check.
|
|
if(src.clumsy_check)
|
|
if(istype(user, /mob/living))
|
|
var/mob/living/M = user
|
|
if ((CLUMSY in M.mutations) && prob(50))
|
|
M << "\red The [src.name] blows up in your face."
|
|
M.take_organ_damage(0,20)
|
|
M.drop_item()
|
|
del(src)
|
|
return
|
|
|
|
if (!user.IsAdvancedToolUser())
|
|
user << "\red You don't have the dexterity to do this!"
|
|
return
|
|
if(istype(user, /mob/living))
|
|
var/mob/living/M = user
|
|
if (HULK in M.mutations)
|
|
M << "\red Your meaty finger is much too large for the trigger guard!"
|
|
return
|
|
|
|
add_fingerprint(user)
|
|
|
|
var/turf/curloc = user.loc
|
|
var/turf/targloc = get_turf(target)
|
|
if (!istype(targloc) || !istype(curloc))
|
|
return
|
|
|
|
if(!special_check(user))
|
|
return
|
|
if(!load_into_chamber())
|
|
user << "\red *click*";
|
|
return
|
|
|
|
if(!in_chamber)
|
|
return
|
|
|
|
in_chamber.firer = user
|
|
in_chamber.def_zone = user.zone_sel.selecting
|
|
|
|
|
|
if(targloc == curloc)
|
|
user.bullet_act(in_chamber)
|
|
del(in_chamber)
|
|
update_icon()
|
|
return
|
|
|
|
if(recoil)
|
|
spawn()
|
|
shake_camera(user, recoil + 1, recoil)
|
|
|
|
if(silenced)
|
|
playsound(user, fire_sound, 10, 1)
|
|
else
|
|
playsound(user, fire_sound, 50, 1)
|
|
user.visible_message("\red [user.name] fires the [src.name]!", "\red You fire the [src.name]!", "\blue You hear a [istype(in_chamber, /obj/item/projectile/beam) ? "laser blast" : "gunshot"]!")
|
|
|
|
in_chamber.original = target
|
|
in_chamber.loc = get_turf(user)
|
|
in_chamber.starting = get_turf(user)
|
|
in_chamber.shot_from = src
|
|
user.next_move = world.time + 4
|
|
in_chamber.silenced = silenced
|
|
in_chamber.current = curloc
|
|
in_chamber.yo = targloc.y - curloc.y
|
|
in_chamber.xo = targloc.x - curloc.x
|
|
|
|
if(params)
|
|
var/list/mouse_control = params2list(params)
|
|
if(mouse_control["icon-x"])
|
|
in_chamber.p_x = text2num(mouse_control["icon-x"])
|
|
if(mouse_control["icon-y"])
|
|
in_chamber.p_y = text2num(mouse_control["icon-y"])
|
|
|
|
spawn()
|
|
if(in_chamber)
|
|
in_chamber.process()
|
|
sleep(1)
|
|
in_chamber = null
|
|
|
|
update_icon()
|
|
return
|
|
|