mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
Merge pull request #8257 from phil235/ReflectFix
Simplifies laser reflection code
This commit is contained in:
@@ -224,9 +224,6 @@
|
||||
remaining_uses--
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/shield/changeling/IsReflect()
|
||||
return 0
|
||||
|
||||
|
||||
/***************************************\
|
||||
|*********SPACE SUIT + HELMET***********|
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
var/list/armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
var/list/allowed = null //suit storage stuff.
|
||||
var/obj/item/device/uplink/hidden/hidden_uplink = null // All items can have an uplink hidden inside, just remember to add the triggers.
|
||||
var/reflect_chance = 0 //This var dictates what % of a time an object will reflect an energy based weapon's shot
|
||||
var/strip_delay = 40
|
||||
var/put_on_delay = 20
|
||||
var/m_amt = 0 // metal
|
||||
@@ -315,8 +314,7 @@
|
||||
return 0
|
||||
|
||||
/obj/item/proc/IsReflect(var/def_zone) //This proc determines if and at what% an object will reflect energy projectiles if it's in l_hand,r_hand or wear_suit
|
||||
if(prob(reflect_chance))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/proc/eyestab(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@
|
||||
w_class = 4
|
||||
playsound(user, 'sound/weapons/saberon.ogg', 35, 1)
|
||||
user << "<span class='notice'>[src] is now active.</span>"
|
||||
reflect_chance = 40
|
||||
else
|
||||
force = 3
|
||||
throwforce = 3
|
||||
@@ -78,7 +77,6 @@
|
||||
w_class = 1
|
||||
playsound(user, 'sound/weapons/saberoff.ogg', 35, 1)
|
||||
user << "<span class='notice'>[src] can now be concealed.</span>"
|
||||
reflect_chance = 0
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/item/weapon/shield/riot/tele
|
||||
|
||||
@@ -192,7 +192,6 @@ obj/item/weapon/twohanded/
|
||||
item_color = "green"
|
||||
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
|
||||
var/hacked = 0
|
||||
reflect_chance = 0
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/New()
|
||||
item_color = pick("red", "blue", "green", "purple")
|
||||
@@ -234,7 +233,7 @@ obj/item/weapon/twohanded/
|
||||
user << "<span class='warning'>You cant pick up such dangerous item with your meaty hands without losing fingers, better not to.</span>"
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/wield(mob/living/carbon/M) //Specific wield () hulk checks due to reflect_chance var for balance issues and switches hitsounds.
|
||||
/obj/item/weapon/twohanded/dualsaber/wield(mob/living/carbon/M) //Specific wield () hulk checks due to reflection chance for balance issues and switches hitsounds.
|
||||
if(istype(M))
|
||||
if(M.dna.check_mutation(HULK))
|
||||
M << "<span class='warning'>You lack the grace to wield this.</span>"
|
||||
|
||||
@@ -91,10 +91,9 @@
|
||||
item_state = "armor_reflec"
|
||||
blood_overlay_type = "armor"
|
||||
armor = list(melee = 10, bullet = 10, laser = 80, energy = 50, bomb = 0, bio = 0, rad = 0)
|
||||
reflect_chance = 40
|
||||
var/hit_reflect_chance = 40
|
||||
|
||||
/obj/item/clothing/suit/armor/laserproof/IsReflect(var/def_zone)
|
||||
var/hit_reflect_chance = reflect_chance
|
||||
if(!(def_zone in list("chest", "groin"))) //If not shot where ablative is covering you, you don't get the reflection bonus!
|
||||
hit_reflect_chance = 0
|
||||
if (prob(hit_reflect_chance))
|
||||
|
||||
@@ -67,7 +67,7 @@ emp_act
|
||||
return 2
|
||||
return (..(P , def_zone))
|
||||
|
||||
/mob/living/carbon/human/proc/check_reflect(var/def_zone) //Reflection checks for anything in your l_hand, r_hand, or wear_suit based on reflect_chance var of the object
|
||||
/mob/living/carbon/human/proc/check_reflect(var/def_zone) //Reflection checks for anything in your l_hand, r_hand, or wear_suit based on the reflection chance of the object
|
||||
if(wear_suit && istype(wear_suit, /obj/item/))
|
||||
var/obj/item/I = wear_suit
|
||||
if(I.IsReflect(def_zone) == 1)
|
||||
|
||||
Reference in New Issue
Block a user