Merge pull request #48505 from ninjanomnom/waddle-element

Makes waddling an element
This commit is contained in:
81Denton
2020-01-01 17:19:17 +01:00
committed by GitHub
7 changed files with 32 additions and 32 deletions
-22
View File
@@ -1,22 +0,0 @@
/datum/component/waddling
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
/datum/component/waddling/Initialize()
. = ..()
if(!ismovableatom(parent))
return COMPONENT_INCOMPATIBLE
if(isliving(parent))
RegisterSignal(parent, list(COMSIG_MOVABLE_MOVED), .proc/LivingWaddle)
else
RegisterSignal(parent, list(COMSIG_MOVABLE_MOVED), .proc/Waddle)
/datum/component/waddling/proc/LivingWaddle()
var/mob/living/L = parent
if(L.incapacitated() || !(L.mobility_flags & MOBILITY_STAND))
return
Waddle()
/datum/component/waddling/proc/Waddle()
animate(parent, pixel_z = 4, time = 0)
animate(pixel_z = 0, transform = turn(matrix(), pick(-12, 0, 12)), time=2)
animate(pixel_z = 0, transform = matrix(), time = 0)
+24
View File
@@ -0,0 +1,24 @@
/datum/element/waddling
/datum/element/waddling/Attach(datum/target)
. = ..()
if(!ismovableatom(target))
return ELEMENT_INCOMPATIBLE
if(isliving(target))
RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/LivingWaddle)
else
RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/Waddle)
/datum/element/waddling/Detach(datum/source, force)
. = ..()
UnregisterSignal(source, COMSIG_MOVABLE_MOVED)
/datum/element/waddling/proc/LivingWaddle(mob/living/target)
if(target.incapacitated() || !(target.mobility_flags & MOBILITY_STAND))
return
Waddle()
/datum/element/waddling/proc/Waddle(atom/movable/target)
animate(target, pixel_z = 4, time = 0)
animate(target, pixel_z = 0, transform = turn(matrix(), pick(-12, 0, 12)), time=2)
animate(target, pixel_z = 0, transform = matrix(), time = 0)
+3 -4
View File
@@ -74,7 +74,6 @@
item_state = "clown_shoes"
slowdown = SHOES_SLOWDOWN+1
pocket_storage_component_path = /datum/component/storage/concrete/pockets/shoes/clown
var/datum/component/waddle
var/enabled_waddle = TRUE
/obj/item/clothing/shoes/clown_shoes/Initialize()
@@ -85,13 +84,13 @@
. = ..()
if(slot == ITEM_SLOT_FEET)
if(enabled_waddle)
waddle = user.AddComponent(/datum/component/waddling)
user.AddElement(/datum/element/waddling)
if(user.mind && user.mind.assigned_role == "Clown")
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "clownshoes", /datum/mood_event/clownshoes)
/obj/item/clothing/shoes/clown_shoes/dropped(mob/user)
. = ..()
QDEL_NULL(waddle)
user.RemoveElement(/datum/element/waddling)
if(user.mind && user.mind.assigned_role == "Clown")
SEND_SIGNAL(user, COMSIG_CLEAR_MOOD_EVENT, "clownshoes")
@@ -414,7 +413,7 @@
loot = list(
/obj/item/clothing/shoes/cowboy/lizard = 7,
/obj/item/clothing/shoes/cowboy/lizard/masterwork = 1)
/obj/item/clothing/shoes/cookflops
desc = "All this talk of antags, greytiding, and griefing... I just wanna grill for god's sake!"
name = "grilling sandals"
@@ -23,7 +23,7 @@
/mob/living/simple_animal/pet/penguin/Initialize()
. = ..()
AddComponent(/datum/component/waddling)
AddElement(/datum/element/waddling)
/mob/living/simple_animal/pet/penguin/emperor
name = "Emperor penguin"
+2 -3
View File
@@ -114,19 +114,18 @@
/obj/item/organ/ears/penguin
name = "penguin ears"
desc = "The source of a penguin's happy feet."
var/datum/component/waddle
/obj/item/organ/ears/penguin/Insert(mob/living/carbon/human/H, special = 0, drop_if_replaced = TRUE)
. = ..()
if(istype(H))
to_chat(H, "<span class='notice'>You suddenly feel like you've lost your balance.</span>")
waddle = H.AddComponent(/datum/component/waddling)
H.AddElement(/datum/element/waddling)
/obj/item/organ/ears/penguin/Remove(mob/living/carbon/human/H, special = 0)
. = ..()
if(istype(H))
to_chat(H, "<span class='notice'>Your sense of balance comes back to you.</span>")
QDEL_NULL(waddle)
H.RemoveElement(/datum/element/waddling)
/obj/item/organ/ears/bronze
name = "tin ears"
+1 -1
View File
@@ -92,7 +92,7 @@
to_chat(user, "<span class='danger'>You scramble \the [src]'s child safety lock, and a panel with six colorful buttons appears!</span>")
initialize_controller_action_type(/datum/action/vehicle/sealed/RollTheDice, VEHICLE_CONTROL_DRIVE)
initialize_controller_action_type(/datum/action/vehicle/sealed/Cannon, VEHICLE_CONTROL_DRIVE)
AddComponent(/datum/component/waddling)
AddElement(/datum/element/waddling)
/obj/vehicle/sealed/car/clowncar/Destroy()
playsound(src, 'sound/vehicles/clowncar_fart.ogg', 100)
+1 -1
View File
@@ -428,7 +428,6 @@
#include "code\datums\components\tether.dm"
#include "code\datums\components\thermite.dm"
#include "code\datums\components\uplink.dm"
#include "code\datums\components\waddling.dm"
#include "code\datums\components\wearertargeting.dm"
#include "code\datums\components\wet_floor.dm"
#include "code\datums\components\crafting\crafting.dm"
@@ -521,6 +520,7 @@
#include "code\datums\elements\selfknockback.dm"
#include "code\datums\elements\snail_crawl.dm"
#include "code\datums\elements\squish.dm"
#include "code\datums\elements\waddling.dm"
#include "code\datums\helper_datums\events.dm"
#include "code\datums\helper_datums\getrev.dm"
#include "code\datums\helper_datums\icon_snapshot.dm"