Uses squeak component to do this, fixes broken stuff & Travis

This commit is contained in:
Citinited
2019-01-05 16:50:11 +00:00
parent 27b7c87585
commit eebd8d782f
10 changed files with 70 additions and 69 deletions
+3 -41
View File
@@ -1,43 +1,5 @@
/datum/component/jestosterone
var/mob_is_clown //Is the affected mob a clown?
var/mind_type //Is the affected mob a clown / mime?
/datum/component/jestosterone/Initialize(mob/user, is_this_mob_a_clown)
mob_is_clown = is_this_mob_a_clown
if(mob_is_clown)
to_chat(user, "<span class='notice'>Whatever that was, it feels great!</span>")
else
to_chat(user, "<span class='warning'>Something doesn't feel right...</span>")
RegisterSignal(COMSIG_MOVABLE_MOVED, .proc/on_move)
RegisterSignal(COMSIG_PARENT_ATTACKBY, .proc/mob_was_attacked)
RegisterSignal(COMSIG_ITEM_ATTACK, .proc/mob_was_attacked)
RegisterSignal(COMSIG_ATOM_ATTACK_ALIEN, .proc/mob_was_attacked)
RegisterSignal(COMSIG_ON_MOB_LIFE, .proc/process_jestosterone)
/datum/component/jestosterone/proc/on_move(mob/user)
playsound(user.loc, "clownstep", 25, 1)
/datum/component/jestosterone/proc/mob_was_attacked(mob/user)
playsound(user.loc, 'sound/items/bikehorn.ogg', 50, 1)
/datum/component/jestosterone/proc/process_jestosterone(mob/living/user)
if(prob(10))
user.emote("giggle")
if(mob_is_clown)
user.adjustBruteLoss(-1.5 * REAGENTS_EFFECT_MULTIPLIER) //Screw those pesky clown beatings!
else
user.AdjustDizzy(10, 0, 500)
user.Druggy(15)
if(prob(10))
user.EyeBlurry(5)
if(prob(6))
var/list/clown_message = list("You feel light-headed.",
"You can't see straight.",
"You feel about as funny as the station clown.",
"Bright colours and rainbows cloud your vision.",
"Your funny bone aches.",
"You can hear bike horns in the distance.",
"You feel like <em>SHOUTING</em>!",
"Sinister laughter echoes in your ears.",
"Your legs feel like jelly.",
"You feel like telling a pun.")
to_chat(user, "<span class='warning'>[pick(clown_message)]</span>")
/datum/component/jestosterone/Initialize(mind_type_arg)
mind_type = mind_type_arg
+11 -6
View File
@@ -14,7 +14,7 @@
var/last_use = 0
var/use_delay = 20
/datum/component/squeak/Initialize(custom_sounds, volume_override, chance_override, step_delay_override, use_delay_override)
/datum/component/squeak/Initialize(custom_sounds, volume_override, chance_override, step_delay_override, use_delay_override, squeak_on_move)
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, list(COMSIG_ATOM_ENTERED, COMSIG_ATOM_BLOB_ACT, COMSIG_ATOM_HULK_ATTACK, COMSIG_PARENT_ATTACKBY), .proc/play_squeak)
@@ -22,6 +22,8 @@
RegisterSignal(parent, list(COMSIG_MOVABLE_BUMP, COMSIG_MOVABLE_IMPACT), .proc/play_squeak)
RegisterSignal(parent, COMSIG_MOVABLE_CROSSED, .proc/play_squeak_crossed)
RegisterSignal(parent, COMSIG_MOVABLE_DISPOSING, .proc/disposing_react)
if(squeak_on_move)
RegisterSignal(parent, COMSIG_MOVABLE_MOVED, .proc/play_squeak)
if(isitem(parent))
RegisterSignal(parent, list(COMSIG_ITEM_ATTACK, COMSIG_ITEM_ATTACK_OBJ, COMSIG_ITEM_HIT_REACT), .proc/play_squeak)
RegisterSignal(parent, COMSIG_ITEM_ATTACK_SELF, .proc/use_squeak)
@@ -47,12 +49,15 @@
else
playsound(parent, pickweight(override_squeak_sounds), volume, 1, -1)
/datum/component/squeak/proc/step_squeak()
if(steps > step_delay)
play_squeak()
steps = 0
/datum/component/squeak/proc/step_squeak(datum/source, mob/living/carbon/human/H)
if(H.m_intent == MOVE_INTENT_RUN)
if(steps > step_delay)
play_squeak()
steps = 0
else
steps++
else
steps++
play_squeak()
/datum/component/squeak/proc/on_equip(datum/source, mob/equipper, slot)
RegisterSignal(equipper, COMSIG_MOVABLE_DISPOSING, .proc/disposing_react, TRUE)