Refactors slipping to be completely general for items

This commit is contained in:
Crazylemon64
2017-07-16 19:20:55 -07:00
parent 12317a77b9
commit a8e7716649
13 changed files with 90 additions and 53 deletions
+20
View File
@@ -87,6 +87,15 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
var/sprite_sheets_obj = null //Used to override hardcoded clothing inventory object dmis in human clothing proc.
var/list/species_fit = null //This object has a different appearance when worn by these species
var/trip_verb = TV_TRIP
var/trip_bonus = 0
var/trip_stun = 0
var/trip_weaken = 2
var/trip_any = FALSE
var/trip_walksafe = TRUE
var/trip_tiles = 0
/obj/item/New()
..()
for(var/path in actions_types)
@@ -530,3 +539,14 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
/obj/item/proc/is_equivalent(obj/item/I)
return I == src
/obj/item/Crossed(atom/movable/AM)
if(ishuman(AM))
var/mob/living/carbon/human/H = AM
if(prob(trip_bonus))
on_trip(H)
/obj/item/proc/on_trip(mob/living/carbon/human/H)
if(H.slip(src, trip_stun, trip_weaken, trip_tiles, trip_walksafe, trip_any, trip_verb))
H.visible_message("<span class='warning'>[H] [trip_verb]s on [src]!</span>")
return TRUE