mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 15:08:02 +01:00
Uses squeak component to do this, fixes broken stuff & Travis
This commit is contained in:
@@ -55,7 +55,6 @@
|
||||
#define COMSIG_ATOM_FIRE_ACT "atom_fire_act" //from base of atom/fire_act(): (exposed_temperature, exposed_volume)
|
||||
#define COMSIG_ATOM_BULLET_ACT "atom_bullet_act" //from base of atom/bullet_act(): (/obj/item/projectile, def_zone)
|
||||
#define COMSIG_ATOM_BLOB_ACT "atom_blob_act" //from base of atom/blob_act(): (/obj/structure/blob)
|
||||
#define COMSIG_ATOM_ATTACK_ALIEN "atom_attack_alien" //from base of atom/attack_alien()
|
||||
#define COMSIG_ATOM_ACID_ACT "atom_acid_act" //from base of atom/acid_act(): (acidpwr, acid_volume)
|
||||
#define COMSIG_ATOM_EMAG_ACT "atom_emag_act" //from base of atom/emag_act(): ()
|
||||
#define COMSIG_ATOM_RAD_ACT "atom_rad_act" //from base of atom/rad_act(intensity)
|
||||
@@ -221,9 +220,6 @@
|
||||
//Food
|
||||
#define COMSIG_FOOD_EATEN "food_eaten" //from base of obj/item/reagent_containers/food/snacks/attack(): (mob/living/eater, mob/feeder)
|
||||
|
||||
//Reagents
|
||||
#define COMSIG_ON_MOB_LIFE "on_mob_life" //Called when a reagent calls on_mob_life
|
||||
|
||||
//Mood
|
||||
#define COMSIG_ADD_MOOD_EVENT "add_mood" //Called when you send a mood event from anywhere in the code.
|
||||
#define COMSIG_CLEAR_MOOD_EVENT "clear_mood" //Called when you clear a mood event from anywhere in the code.
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
if(!force)
|
||||
playsound(loc, 'sound/weapons/tap.ogg', get_clamped_volume(), 1, -1)
|
||||
else
|
||||
M.SendSignal(COMSIG_ITEM_ATTACK, M)
|
||||
SEND_SIGNAL(M, COMSIG_ITEM_ATTACK)
|
||||
if(hitsound)
|
||||
playsound(loc, hitsound, get_clamped_volume(), 1, -1)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -121,7 +121,8 @@
|
||||
span = mind.speech_span
|
||||
if((COMIC in mutations) \
|
||||
|| (locate(/obj/item/organ/internal/cyberimp/brain/clown_voice) in internal_organs) \
|
||||
|| istype(get_item_by_slot(slot_wear_mask), /obj/item/clothing/mask/gas/voice/clown))
|
||||
|| istype(get_item_by_slot(slot_wear_mask), /obj/item/clothing/mask/gas/voice/clown) \
|
||||
|| GetComponent(/datum/component/jestosterone))
|
||||
span = "sans"
|
||||
|
||||
var/list/parent = ..()
|
||||
|
||||
@@ -389,7 +389,7 @@
|
||||
target.forcesay(GLOB.hit_appends)
|
||||
else if(target.lying)
|
||||
target.forcesay(GLOB.hit_appends)
|
||||
target.SendSignal(COMSIG_PARENT_ATTACKBY, target)
|
||||
SEND_SIGNAL(target, COMSIG_PARENT_ATTACKBY)
|
||||
|
||||
/datum/species/proc/disarm(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
|
||||
if(target.check_block()) //cqc
|
||||
|
||||
@@ -508,7 +508,7 @@
|
||||
var/turf/T = loc
|
||||
. = ..()
|
||||
if(.)
|
||||
SendSignal(COMSIG_MOVABLE_MOVED, src)
|
||||
SEND_SIGNAL(src, COMSIG_MOVABLE_MOVED)
|
||||
handle_footstep(loc)
|
||||
step_count++
|
||||
|
||||
@@ -883,7 +883,7 @@
|
||||
// If we're pulling something then drop what we're currently pulling and pull this instead.
|
||||
AM.add_fingerprint(src)
|
||||
if(pulling)
|
||||
if(AM == pulling)// Are we trying to pull something we are already pulling? Then just stop here, no need to continue.
|
||||
if(AM == pulling)// Are we trying to pull something we are already pulling? Then just stop here, no need to continue.
|
||||
return
|
||||
stop_pulling()
|
||||
if(AM.pulledby)
|
||||
|
||||
@@ -333,7 +333,6 @@
|
||||
return FALSE
|
||||
if(INTENT_HARM)
|
||||
M.do_attack_animation(src)
|
||||
SendSignal(COMSIG_ATOM_ATTACK_ALIEN, src)
|
||||
return TRUE
|
||||
if(INTENT_DISARM)
|
||||
M.do_attack_animation(src, ATTACK_EFFECT_DISARM)
|
||||
|
||||
@@ -577,9 +577,9 @@ var/const/INGEST = 2
|
||||
reagent_list += R
|
||||
R.holder = src
|
||||
R.volume = amount
|
||||
R.on_new(data)
|
||||
if(data)
|
||||
R.data = data
|
||||
R.on_new(data)
|
||||
|
||||
update_total()
|
||||
if(my_atom)
|
||||
|
||||
@@ -426,25 +426,63 @@
|
||||
color = "#ff00ff" //Fuchsia, pity we can't do rainbow here
|
||||
taste_message = "a funny flavour"
|
||||
|
||||
/datum/reagent/jestosterone/reaction_mob(mob/living/M, method, volume)
|
||||
/datum/reagent/jestosterone/on_new()
|
||||
..()
|
||||
if(istype(M, /mob/living/carbon))
|
||||
var/mob/living/carbon/C = holder.my_atom
|
||||
if(!istype(C))
|
||||
return
|
||||
var/is_a_clown = FALSE
|
||||
if(M.mind && (M.mind.assigned_role == "Clown" || M.mind.assigned_role == SPECIAL_ROLE_HONKSQUAD))
|
||||
is_a_clown = TRUE
|
||||
if(!is_a_clown)
|
||||
M.AdjustDizzy(volume)
|
||||
M.AddComponent(/datum/component/jestosterone, M, is_a_clown)
|
||||
var/mind_type = FALSE
|
||||
if(C.mind)
|
||||
if(C.mind.assigned_role == "Clown" || C.mind.assigned_role == SPECIAL_ROLE_HONKSQUAD)
|
||||
mind_type = "Clown"
|
||||
to_chat(C, "<span class='notice'>Whatever that was, it feels great!</span>")
|
||||
else if(C.mind.assigned_role == "Mime")
|
||||
mind_type = "Mime"
|
||||
to_chat(C, "<span class='warning'>You feel nauseous.</span>")
|
||||
C.AdjustDizzy(volume)
|
||||
else
|
||||
to_chat(C, "<span class='warning'>Something doesn't feel right...</span>")
|
||||
C.AdjustDizzy(volume)
|
||||
C.AddComponent(/datum/component/jestosterone, mind_type)
|
||||
C.AddComponent(/datum/component/squeak, null, null, null, null, null, TRUE)
|
||||
|
||||
/datum/reagent/jestosterone/on_mob_life(mob/living/M)
|
||||
M.SendSignal(COMSIG_ON_MOB_LIFE, M)
|
||||
..()
|
||||
/datum/reagent/jestosterone/on_mob_life(mob/living/carbon/M)
|
||||
if(!istype(M))
|
||||
return ..()
|
||||
var/update_flags = STATUS_UPDATE_NONE
|
||||
if(prob(10))
|
||||
M.emote("giggle")
|
||||
GET_COMPONENT_FROM(jestosterone_component, /datum/component/jestosterone, M)
|
||||
if(jestosterone_component.mind_type == "Clown")
|
||||
update_flags |= M.adjustBruteLoss(-1.5 * REAGENTS_EFFECT_MULTIPLIER) //Screw those pesky clown beatings!
|
||||
else
|
||||
M.AdjustDizzy(10, 0, 500)
|
||||
M.Druggy(15)
|
||||
if(prob(10))
|
||||
M.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.",
|
||||
"What was that?!",
|
||||
"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(M, "<span class='warning'>[pick(clown_message)]</span>")
|
||||
if(jestosterone_component.mind_type == "Mime")
|
||||
update_flags |= M.adjustToxLoss(1.5 * REAGENTS_EFFECT_MULTIPLIER)
|
||||
return ..() | update_flags
|
||||
|
||||
/datum/reagent/jestosterone/on_mob_delete(mob/living/M)
|
||||
..()
|
||||
GET_COMPONENT_FROM(remove_fun, /datum/component/jestosterone, M)
|
||||
GET_COMPONENT_FROM(squeaking, /datum/component/squeak, M)
|
||||
remove_fun.Destroy()
|
||||
squeaking.Destroy()
|
||||
|
||||
/datum/reagent/royal_bee_jelly
|
||||
name = "royal bee jelly"
|
||||
|
||||
Reference in New Issue
Block a user