Merge pull request #2622 from Anewbe/actual_embed_changes

Changes the way embedding works
This commit is contained in:
Neerti
2016-10-16 17:27:52 -04:00
committed by GitHub
9 changed files with 74 additions and 23 deletions

View File

@@ -49,6 +49,8 @@
var/zoomdevicename = null //name used for message when binoculars/scope is used
var/zoom = 0 //1 if item is actively being used to zoom. For scoped guns and binoculars.
var/embed_chance = -1 //-1 makes it calculate embed chance, 0 won't embed, and 100 will always embed
var/icon_override = null //Used to override hardcoded clothing dmis in human clothing proc.
//** These specify item/icon overrides for _slots_
@@ -75,6 +77,14 @@
// Works similarly to worn sprite_sheets, except the alternate sprites are used when the clothing/refit_for_species() proc is called.
var/list/sprite_sheets_obj = list()
/obj/item/New()
if(embed_chance == -1)
if(sharp)
embed_chance = force/w_class
else
embed_chance = force/(w_class*3)
..()
/obj/item/equipped()
..()
var/mob/living/M = loc

View File

@@ -3,6 +3,7 @@
var/active_force
var/active_throwforce
var/active_w_class
var/active_embed_chance = 0 //In the off chance one of these is supposed to embed, you can just tweak this var
sharp = 0
edge = 0
armor_penetration = 50
@@ -12,10 +13,10 @@
var/lcolor = "#0099FF"
/obj/item/weapon/melee/energy/proc/activate(mob/living/user)
anchored = 1
if(active)
return
active = 1
embed_chance = active_embed_chance
force = active_force
throwforce = active_throwforce
sharp = 1
@@ -25,11 +26,11 @@
set_light(lrange, lpower, lcolor)
/obj/item/weapon/melee/energy/proc/deactivate(mob/living/user)
anchored = 0
if(!active)
return
playsound(user, 'sound/weapons/saberoff.ogg', 50, 1)
active = 0
embed_chance = initial(embed_chance)
force = initial(force)
throwforce = initial(throwforce)
sharp = initial(sharp)