mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
Merge branch 'master' of https://github.com/tgstation/tgstation into idigtilmyshoveltellsasecretsweartotheearththatiwillkeepitbrushoffthedirtandletmychangeofheartoccur
Conflicts: code/game/objects/structures/grille.dm icons/effects/beam.dmi
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
force = 5
|
||||
origin_tech = "combat=1"
|
||||
needs_permit = 1
|
||||
unique_rename = 0
|
||||
attack_verb = list("struck", "hit", "bashed")
|
||||
|
||||
var/fire_sound = "gunshot"
|
||||
@@ -31,11 +32,8 @@
|
||||
var/firing_burst = 0 //Prevent the weapon from firing again while already firing
|
||||
var/semicd = 0 //cooldown handler
|
||||
var/weapon_weight = WEAPON_LIGHT
|
||||
|
||||
var/spread = 0 //Spread induced by the gun itself.
|
||||
var/randomspread = 1 //Set to 0 for shotguns. This is used for weapons that don't fire all their bullets at once.
|
||||
|
||||
var/unique_rename = 0 //allows renaming with a pen
|
||||
var/unique_reskin = 0 //allows one-time reskinning
|
||||
var/current_skin = null //the skin choice if we had a reskin
|
||||
var/list/options = list()
|
||||
@@ -90,8 +88,6 @@
|
||||
user << "It doesn't have a firing pin installed, and won't fire."
|
||||
if(unique_reskin && !current_skin)
|
||||
user << "<span class='notice'>Alt-click it to reskin it.</span>"
|
||||
if(unique_rename)
|
||||
user << "<span class='notice'>Use a pen on it to rename it.</span>"
|
||||
|
||||
|
||||
/obj/item/weapon/gun/proc/process_chamber()
|
||||
@@ -125,7 +121,7 @@
|
||||
user.visible_message("<span class='danger'>[user] fires [src]!</span>", "<span class='danger'>You fire [src]!</span>", "You hear a [istype(src, /obj/item/weapon/gun/energy) ? "laser blast" : "gunshot"]!")
|
||||
|
||||
if(weapon_weight >= WEAPON_MEDIUM)
|
||||
if(user.get_inactive_hand())
|
||||
if(user.get_inactive_held_item())
|
||||
if(prob(15))
|
||||
if(user.drop_item())
|
||||
user.visible_message("<span class='danger'>[src] flies out of [user]'s hands!</span>", "<span class='userdanger'>[src] kicks out of your grip!</span>")
|
||||
@@ -171,7 +167,7 @@
|
||||
user.drop_item()
|
||||
return
|
||||
|
||||
if(weapon_weight == WEAPON_HEAVY && user.get_inactive_hand())
|
||||
if(weapon_weight == WEAPON_HEAVY && user.get_inactive_held_item())
|
||||
user << "<span class='userdanger'>You need both hands free to fire \the [src]!</span>"
|
||||
return
|
||||
|
||||
@@ -207,7 +203,7 @@ obj/item/weapon/gun/proc/newshot()
|
||||
return
|
||||
|
||||
if(weapon_weight)
|
||||
if(user.get_inactive_hand())
|
||||
if(user.get_inactive_held_item())
|
||||
recoil = 4 //one-handed kick
|
||||
else
|
||||
recoil = initial(recoil)
|
||||
@@ -218,7 +214,7 @@ obj/item/weapon/gun/proc/newshot()
|
||||
if(!user)
|
||||
break
|
||||
if(!issilicon(user))
|
||||
if( i>1 && !(src in get_both_hands(user))) //for burst firing
|
||||
if( i>1 && !(user.is_holding(src))) //for burst firing
|
||||
break
|
||||
if(chambered)
|
||||
var/sprd = 0
|
||||
@@ -261,10 +257,7 @@ obj/item/weapon/gun/proc/newshot()
|
||||
semicd = 0
|
||||
|
||||
if(user)
|
||||
if(user.hand)
|
||||
user.update_inv_l_hand()
|
||||
else
|
||||
user.update_inv_r_hand()
|
||||
user.update_inv_hands()
|
||||
feedback_add_details("gun_fired","[src.type]")
|
||||
|
||||
/obj/item/weapon/gun/attack(mob/M as mob, mob/user)
|
||||
@@ -305,10 +298,7 @@ obj/item/weapon/gun/proc/newshot()
|
||||
for(var/datum/action/item_action/toggle_gunlight/TGL in actions)
|
||||
qdel(TGL)
|
||||
|
||||
if(unique_rename)
|
||||
if(istype(I, /obj/item/weapon/pen))
|
||||
rename_gun(user)
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/proc/toggle_gunlight()
|
||||
set name = "Toggle Gunlight"
|
||||
@@ -389,13 +379,6 @@ obj/item/weapon/gun/proc/newshot()
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/proc/rename_gun(mob/M)
|
||||
var/input = stripped_input(M,"What do you want to name the gun?", ,"", MAX_NAME_LEN)
|
||||
|
||||
if(src && input && !M.stat && in_range(M,src) && !M.restrained() && M.canmove)
|
||||
name = input
|
||||
M << "You name the gun [input]. Say hello to your new friend."
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/gun/proc/handle_suicide(mob/living/carbon/human/user, mob/living/carbon/human/target, params)
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
if (src.can_shoot())
|
||||
user.visible_message("<span class='suicide'>[user] is putting the barrel of the [src.name] in \his mouth. It looks like \he's trying to commit suicide.</span>")
|
||||
sleep(25)
|
||||
if(user.l_hand == src || user.r_hand == src)
|
||||
if(user.is_holding(src))
|
||||
user.visible_message("<span class='suicide'>[user] melts \his face off with the [src.name]!</span>")
|
||||
playsound(loc, fire_sound, 50, 1, -1)
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
if(loc == user)
|
||||
if(suppressed && can_unsuppress)
|
||||
var/obj/item/weapon/suppressor/S = suppressed
|
||||
if(user.l_hand != src && user.r_hand != src)
|
||||
if(!user.is_holding(src))
|
||||
..()
|
||||
return
|
||||
user << "<span class='notice'>You unscrew [suppressed] from [src].</span>"
|
||||
@@ -145,7 +145,7 @@
|
||||
if (src.chambered && src.chambered.BB && !src.chambered.BB.nodamage)
|
||||
user.visible_message("<span class='suicide'>[user] is putting the barrel of the [src.name] in \his mouth. It looks like \he's trying to commit suicide.</span>")
|
||||
sleep(25)
|
||||
if(user.l_hand == src || user.r_hand == src)
|
||||
if(user.is_holding(src))
|
||||
process_fire(user, user, 0, zone_override = "head")
|
||||
user.visible_message("<span class='suicide'>[user] blows \his brains out with the [src.name]!</span>")
|
||||
return(BRUTELOSS)
|
||||
@@ -178,7 +178,7 @@
|
||||
name = "sawn-off [src.name]"
|
||||
desc = sawn_desc
|
||||
w_class = 3
|
||||
item_state = "gun"//phil235 is it different with different skin?
|
||||
item_state = "gun"
|
||||
slot_flags &= ~SLOT_BACK //you can't sling it on your back
|
||||
slot_flags |= SLOT_BELT //but you can wear it on your belt (poorly concealed under a trenchcoat, ideally)
|
||||
sawn_state = SAWN_OFF
|
||||
|
||||
@@ -69,11 +69,7 @@
|
||||
var/obj/screen/inventory/hand/H = over_object
|
||||
if(!M.unEquip(src))
|
||||
return
|
||||
switch(H.slot_id)
|
||||
if(slot_r_hand)
|
||||
M.put_in_r_hand(src)
|
||||
if(slot_l_hand)
|
||||
M.put_in_l_hand(src)
|
||||
M.put_in_hand(src, H.held_index)
|
||||
|
||||
|
||||
/obj/item/weapon/minigunpack/update_icon()
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
if(unique_rename)
|
||||
if(istype(A, /obj/item/weapon/pen))
|
||||
rename_gun(user)
|
||||
rename_weapon(user)
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/attack_self(mob/living/user)
|
||||
var/num_unloaded = 0
|
||||
@@ -111,7 +111,7 @@
|
||||
if(prob(70 - (magazine.ammo_count() * 10))) //minimum probability of 10, maximum of 60
|
||||
playsound(user, fire_sound, 50, 1)
|
||||
user << "<span class='userdanger'>[src] blows up in your face!</span>"
|
||||
user.take_organ_damage(0,20)
|
||||
user.take_bodypart_damage(0,20)
|
||||
user.unEquip(src)
|
||||
return 0
|
||||
..()
|
||||
|
||||
@@ -63,14 +63,26 @@
|
||||
/obj/item/projectile/proc/on_range() //if we want there to be effects when they reach the end of their range
|
||||
qdel(src)
|
||||
|
||||
/obj/item/projectile/proc/on_hit(atom/target, blocked = 0, hit_zone)
|
||||
//to get the correct limb (if any) for the projectile hit message
|
||||
/mob/living/proc/check_limb_hit(hit_zone)
|
||||
if(has_limbs)
|
||||
return hit_zone
|
||||
|
||||
/mob/living/carbon/check_limb_hit(hit_zone)
|
||||
if(get_bodypart(hit_zone))
|
||||
return hit_zone
|
||||
else //when a limb is missing the damage is actually passed to the chest
|
||||
return "chest"
|
||||
|
||||
/obj/item/projectile/proc/on_hit(atom/target, blocked = 0)
|
||||
if(!isliving(target))
|
||||
return 0
|
||||
var/mob/living/L = target
|
||||
if(blocked != 100) // not completely blocked
|
||||
var/organ_hit_text = ""
|
||||
if(L.has_limbs)
|
||||
organ_hit_text = " in \the [parse_zone(def_zone)]"
|
||||
var/limb_hit = L.check_limb_hit(def_zone)//to get the correct message info.
|
||||
if(limb_hit)
|
||||
organ_hit_text = " in \the [parse_zone(limb_hit)]"
|
||||
if(suppressed)
|
||||
playsound(loc, hitsound, 5, 1, -1)
|
||||
L << "<span class='userdanger'>You're shot by \a [src][organ_hit_text]!</span>"
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
icon_state = "pulse1_bl"
|
||||
var/life = 20
|
||||
|
||||
/obj/item/projectile/beam/pulse/heavy/on_hit(atom/target, blocked = 0, hit_zone)
|
||||
/obj/item/projectile/beam/pulse/heavy/on_hit(atom/target, blocked = 0)
|
||||
life -= 10
|
||||
if(life > 0)
|
||||
. = -1
|
||||
|
||||
@@ -174,11 +174,11 @@
|
||||
create_reagents(50)
|
||||
reagents.set_reacting(FALSE)
|
||||
|
||||
/obj/item/projectile/bullet/dart/on_hit(atom/target, blocked = 0, hit_zone)
|
||||
/obj/item/projectile/bullet/dart/on_hit(atom/target, blocked = 0)
|
||||
if(iscarbon(target))
|
||||
var/mob/living/carbon/M = target
|
||||
if(blocked != 100) // not completely blocked
|
||||
if(M.can_inject(null,0,hit_zone,piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body.
|
||||
if(M.can_inject(null, 0, def_zone, piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body.
|
||||
..()
|
||||
reagents.reaction(M, INJECT)
|
||||
reagents.trans_to(M, reagents.total_volume)
|
||||
@@ -188,7 +188,7 @@
|
||||
target.visible_message("<span class='danger'>The [name] was deflected!</span>", \
|
||||
"<span class='userdanger'>You were protected against the [name]!</span>")
|
||||
|
||||
..(target, blocked, hit_zone)
|
||||
..(target, blocked)
|
||||
reagents.set_reacting(TRUE)
|
||||
reagents.handle_reactions()
|
||||
return 1
|
||||
@@ -234,7 +234,7 @@
|
||||
armour_penetration = 50
|
||||
var/breakthings = TRUE
|
||||
|
||||
/obj/item/projectile/bullet/sniper/on_hit(atom/target, blocked = 0, hit_zone)
|
||||
/obj/item/projectile/bullet/sniper/on_hit(atom/target, blocked = 0)
|
||||
if((blocked != 100) && (!ismob(target) && breakthings))
|
||||
target.ex_act(rand(1,2))
|
||||
return ..()
|
||||
@@ -248,7 +248,7 @@
|
||||
weaken = 0
|
||||
breakthings = FALSE
|
||||
|
||||
/obj/item/projectile/bullet/sniper/soporific/on_hit(atom/target, blocked = 0, hit_zone)
|
||||
/obj/item/projectile/bullet/sniper/soporific/on_hit(atom/target, blocked = 0)
|
||||
if((blocked != 100) && istype(target, /mob/living))
|
||||
var/mob/living/L = target
|
||||
L.Sleeping(20)
|
||||
@@ -263,7 +263,7 @@
|
||||
weaken = 0
|
||||
breakthings = FALSE
|
||||
|
||||
/obj/item/projectile/bullet/sniper/haemorrhage/on_hit(atom/target, blocked = 0, hit_zone)
|
||||
/obj/item/projectile/bullet/sniper/haemorrhage/on_hit(atom/target, blocked = 0)
|
||||
if((blocked != 100) && iscarbon(target))
|
||||
var/mob/living/carbon/C = target
|
||||
C.bleed(100)
|
||||
@@ -293,7 +293,7 @@
|
||||
damage = 20
|
||||
armour_penetration = 0
|
||||
|
||||
/obj/item/projectile/bullet/saw/bleeding/on_hit(atom/target, blocked = 0, hit_zone)
|
||||
/obj/item/projectile/bullet/saw/bleeding/on_hit(atom/target, blocked = 0)
|
||||
. = ..()
|
||||
if((blocked != 100) && iscarbon(target))
|
||||
var/mob/living/carbon/C = target
|
||||
|
||||
@@ -98,8 +98,8 @@
|
||||
if(iscarbon(target))
|
||||
var/mob/living/carbon/C = target
|
||||
if(C.dna.species.id == "pod")
|
||||
randmuti(C)
|
||||
randmut(C)
|
||||
C.randmuti()
|
||||
C.randmut()
|
||||
C.updateappearance()
|
||||
C.domutcheck()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user