mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-24 17:11:40 +00:00
Merge pull request #2622 from Anewbe/actual_embed_changes
Changes the way embedding works
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user