Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into Ghommie-cit290
This commit is contained in:
@@ -1,26 +1,48 @@
|
||||
/datum/component/anti_magic
|
||||
var/magic = FALSE
|
||||
var/holy = FALSE
|
||||
var/psychic = FALSE
|
||||
var/allowed_slots = ~ITEM_SLOT_BACKPACK
|
||||
var/charges = INFINITY
|
||||
var/blocks_self = TRUE
|
||||
var/datum/callback/reaction
|
||||
var/datum/callback/expire
|
||||
|
||||
/datum/component/anti_magic/Initialize(_magic = FALSE, _holy = FALSE)
|
||||
/datum/component/anti_magic/Initialize(_magic = FALSE, _holy = FALSE, _psychic = FALSE, _allowed_slots, _charges, _blocks_self = TRUE, datum/callback/_reaction, datum/callback/_expire)
|
||||
if(isitem(parent))
|
||||
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/on_equip)
|
||||
RegisterSignal(parent, COMSIG_ITEM_DROPPED, .proc/on_drop)
|
||||
else if(ismob(parent))
|
||||
RegisterSignal(parent, COMSIG_MOB_RECEIVE_MAGIC, .proc/can_protect)
|
||||
RegisterSignal(parent, COMSIG_MOB_RECEIVE_MAGIC, .proc/protect)
|
||||
else
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
|
||||
magic = _magic
|
||||
holy = _holy
|
||||
psychic = _psychic
|
||||
if(_allowed_slots)
|
||||
allowed_slots = _allowed_slots
|
||||
if(!isnull(_charges))
|
||||
charges = _charges
|
||||
blocks_self = _blocks_self
|
||||
reaction = _reaction
|
||||
expire = _expire
|
||||
|
||||
/datum/component/anti_magic/proc/on_equip(datum/source, mob/equipper, slot)
|
||||
RegisterSignal(equipper, COMSIG_MOB_RECEIVE_MAGIC, .proc/can_protect, TRUE)
|
||||
if(!CHECK_BITFIELD(allowed_slots, slotdefine2slotbit(slot))) //Check that the slot is valid for antimagic
|
||||
UnregisterSignal(equipper, COMSIG_MOB_RECEIVE_MAGIC)
|
||||
return
|
||||
RegisterSignal(equipper, COMSIG_MOB_RECEIVE_MAGIC, .proc/protect, TRUE)
|
||||
|
||||
/datum/component/anti_magic/proc/on_drop(datum/source, mob/user)
|
||||
UnregisterSignal(user, COMSIG_MOB_RECEIVE_MAGIC)
|
||||
|
||||
/datum/component/anti_magic/proc/can_protect(datum/source, _magic, _holy, list/protection_sources)
|
||||
if((_magic && magic) || (_holy && holy))
|
||||
/datum/component/anti_magic/proc/protect(datum/source, mob/user, _magic, _holy, _psychic, chargecost = 1, self, list/protection_sources)
|
||||
if(((_magic && magic) || (_holy && holy) || (_psychic && psychic)) && (!self || blocks_self))
|
||||
protection_sources += parent
|
||||
reaction?.Invoke(user, chargecost)
|
||||
charges -= chargecost
|
||||
if(charges <= 0)
|
||||
expire?.Invoke(user)
|
||||
qdel(src)
|
||||
return COMPONENT_BLOCK_MAGIC
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
return FALSE
|
||||
if(!isliving(AM) && !isobj(AM))
|
||||
return FALSE
|
||||
if(is_type_in_typecache(AM, forbidden_types) || AM.throwing || AM.floating)
|
||||
if(is_type_in_typecache(AM, forbidden_types) || AM.throwing || (AM.movement_type & FLOATING))
|
||||
return FALSE
|
||||
//Flies right over the chasm
|
||||
if(ismob(AM))
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
var/mood_modifier = 1 //Modifier to allow certain mobs to be less affected by moodlets
|
||||
var/datum/mood_event/list/mood_events = list()
|
||||
var/insanity_effect = 0 //is the owner being punished for low mood? If so, how much?
|
||||
var/holdmyinsanityeffect = 0 //before we edit our sanity lets take a look
|
||||
var/obj/screen/mood/screen_obj
|
||||
|
||||
/datum/component/mood/Initialize()
|
||||
@@ -21,8 +20,7 @@
|
||||
|
||||
RegisterSignal(parent, COMSIG_ADD_MOOD_EVENT, .proc/add_event)
|
||||
RegisterSignal(parent, COMSIG_CLEAR_MOOD_EVENT, .proc/clear_event)
|
||||
RegisterSignal(parent, COMSIG_INCREASE_SANITY, .proc/IncreaseSanity)
|
||||
RegisterSignal(parent, COMSIG_DECREASE_SANITY, .proc/DecreaseSanity)
|
||||
RegisterSignal(parent, COMSIG_MODIFY_SANITY, .proc/modify_sanity)
|
||||
|
||||
RegisterSignal(parent, COMSIG_MOB_HUD_CREATED, .proc/modify_hud)
|
||||
var/mob/living/owner = parent
|
||||
@@ -131,31 +129,23 @@
|
||||
|
||||
switch(mood_level)
|
||||
if(1)
|
||||
DecreaseSanity(src, 0.2)
|
||||
setSanity(sanity-0.2)
|
||||
if(2)
|
||||
DecreaseSanity(src, 0.125, SANITY_CRAZY)
|
||||
setSanity(sanity-0.125, minimum=SANITY_CRAZY)
|
||||
if(3)
|
||||
DecreaseSanity(src, 0.075, SANITY_UNSTABLE)
|
||||
setSanity(sanity-0.075, minimum=SANITY_UNSTABLE)
|
||||
if(4)
|
||||
DecreaseSanity(src, 0.025, SANITY_DISTURBED)
|
||||
setSanity(sanity-0.025, minimum=SANITY_DISTURBED)
|
||||
if(5)
|
||||
IncreaseSanity(src, 0.1)
|
||||
setSanity(sanity+0.1)
|
||||
if(6)
|
||||
IncreaseSanity(src, 0.15)
|
||||
setSanity(sanity+0.15)
|
||||
if(7)
|
||||
IncreaseSanity(src, 0.20)
|
||||
setSanity(sanity+0.20)
|
||||
if(8)
|
||||
IncreaseSanity(src, 0.25, SANITY_GREAT)
|
||||
setSanity(sanity+0.25, maximum=SANITY_GREAT)
|
||||
if(9)
|
||||
IncreaseSanity(src, 0.4, SANITY_GREAT)
|
||||
|
||||
/*
|
||||
if(insanity_effect != holdmyinsanityeffect)
|
||||
if(insanity_effect > holdmyinsanityeffect)
|
||||
owner.crit_threshold += (insanity_effect - holdmyinsanityeffect)
|
||||
else
|
||||
owner.crit_threshold -= (holdmyinsanityeffect - insanity_effect)
|
||||
*/
|
||||
setSanity(sanity+0.4, maximum=SANITY_GREAT)
|
||||
|
||||
if(HAS_TRAIT(owner, TRAIT_DEPRESSION))
|
||||
if(prob(0.05))
|
||||
@@ -166,8 +156,6 @@
|
||||
add_event(null, "jolly", /datum/mood_event/jolly)
|
||||
clear_event(null, "depression")
|
||||
|
||||
holdmyinsanityeffect = insanity_effect
|
||||
|
||||
HandleNutrition(owner)
|
||||
|
||||
/datum/component/mood/proc/setSanity(amount, minimum=SANITY_INSANE, maximum=SANITY_NEUTRAL)//I'm sure bunging this in here will have no negative repercussions.
|
||||
@@ -189,7 +177,7 @@
|
||||
sanity = amount
|
||||
|
||||
switch(sanity)
|
||||
if(SANITY_INSANE to SANITY_CRAZY)
|
||||
if(-INFINITY to SANITY_CRAZY)
|
||||
setInsanityEffect(MAJOR_INSANITY_PEN)
|
||||
master.add_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE, 100, override=TRUE, multiplicative_slowdown=1.5) //Did we change something ? movetypes is runtiming, movetypes=(~FLYING))
|
||||
sanity_level = 6
|
||||
@@ -222,31 +210,8 @@
|
||||
//master.crit_threshold = (master.crit_threshold - insanity_effect) + newval
|
||||
insanity_effect = newval
|
||||
|
||||
/datum/component/mood/proc/DecreaseSanity(datum/source, amount, minimum = SANITY_INSANE)
|
||||
if(sanity < minimum) //This might make KevinZ stop fucking pinging me.
|
||||
IncreaseSanity(src, 0.5)
|
||||
else
|
||||
sanity = max(minimum, sanity - amount)
|
||||
if(sanity < SANITY_UNSTABLE)
|
||||
if(sanity < SANITY_CRAZY)
|
||||
insanity_effect = (MAJOR_INSANITY_PEN)
|
||||
else
|
||||
insanity_effect = (MINOR_INSANITY_PEN)
|
||||
|
||||
/datum/component/mood/proc/IncreaseSanity(datum/source, amount, maximum = SANITY_NEUTRAL)
|
||||
// Disturbed stops you from getting any more sane - I'm just gonna bung this in here
|
||||
var/mob/living/owner = parent
|
||||
if(HAS_TRAIT(owner, TRAIT_UNSTABLE))
|
||||
return
|
||||
if(sanity > maximum)
|
||||
DecreaseSanity(src, 0.5) //Removes some sanity to go back to our current limit.
|
||||
else
|
||||
sanity = min(maximum, sanity + amount)
|
||||
if(sanity > SANITY_CRAZY)
|
||||
if(sanity > SANITY_UNSTABLE)
|
||||
insanity_effect = 0
|
||||
else
|
||||
insanity_effect = MINOR_INSANITY_PEN
|
||||
/datum/component/mood/proc/modify_sanity(datum/source, amount, minimum = -INFINITY, maximum = INFINITY)
|
||||
setSanity(sanity + amount, minimum, maximum)
|
||||
|
||||
/datum/component/mood/proc/add_event(datum/source, category, type, param) //Category will override any events in the same category, should be unique unless the event is based on the same thing like hunger.
|
||||
var/datum/mood_event/the_event
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
set src in oview(1)
|
||||
var/datum/component/simple_rotation/rotcomp = GetComponent(/datum/component/simple_rotation)
|
||||
if(rotcomp)
|
||||
rotcomp.HandRot(usr,ROTATION_CLOCKWISE)
|
||||
rotcomp.HandRot(null,usr,ROTATION_CLOCKWISE)
|
||||
|
||||
/atom/movable/proc/simple_rotate_counterclockwise()
|
||||
set name = "Rotate Counter-Clockwise"
|
||||
@@ -153,7 +153,7 @@
|
||||
set src in oview(1)
|
||||
var/datum/component/simple_rotation/rotcomp = GetComponent(/datum/component/simple_rotation)
|
||||
if(rotcomp)
|
||||
rotcomp.HandRot(usr,ROTATION_COUNTERCLOCKWISE)
|
||||
rotcomp.HandRot(null,usr,ROTATION_COUNTERCLOCKWISE)
|
||||
|
||||
/atom/movable/proc/simple_rotate_flip()
|
||||
set name = "Flip"
|
||||
@@ -161,4 +161,4 @@
|
||||
set src in oview(1)
|
||||
var/datum/component/simple_rotation/rotcomp = GetComponent(/datum/component/simple_rotation)
|
||||
if(rotcomp)
|
||||
rotcomp.HandRot(usr,ROTATION_FLIP)
|
||||
rotcomp.HandRot(null,usr,ROTATION_FLIP)
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
var/config_max_users = 0
|
||||
var/config_min_users = 0
|
||||
var/voteweight = 1
|
||||
var/max_round_search_span = 0 //If this is nonzero, then if the map has been played more than max_rounds_played within the search span (max determined by define in persistence.dm), this map won't be available.
|
||||
var/max_rounds_played = 0
|
||||
|
||||
// Config actually from the JSON - should default to Box
|
||||
var/map_name = "Box Station"
|
||||
@@ -23,6 +25,10 @@
|
||||
|
||||
var/minetype = "lavaland"
|
||||
|
||||
var/maptype = MAP_TYPE_STATION //This should be used to adjust ingame behavior depending on the specific type of map being played. For instance, if an overmap were added, it'd be appropriate for it to only generate with a MAP_TYPE_SHIP
|
||||
|
||||
var/announcertype = "standard" //Determines the announcer the map uses. standard uses the default announcer, classic, but has a random chance to use other similarly-themed announcers, like medibot
|
||||
|
||||
var/allow_custom_shuttles = TRUE
|
||||
var/shuttles = list(
|
||||
"cargo" = "cargo_box",
|
||||
@@ -30,6 +36,8 @@
|
||||
"whiteship" = "whiteship_box",
|
||||
"emergency" = "emergency_box")
|
||||
|
||||
var/year_offset = 540 //The offset of ingame year from the actual IRL year. You know you want to make a map that takes place in the 90's. Don't lie.
|
||||
|
||||
/proc/load_map_config(filename = "data/next_map.json", default_to_box, delete_after, error_if_missing = TRUE)
|
||||
var/datum/map_config/config = new
|
||||
if (default_to_box)
|
||||
@@ -122,8 +130,21 @@
|
||||
log_world("map_config space_empty_levels is not a number!")
|
||||
return
|
||||
|
||||
temp = json["year_offset"]
|
||||
if (isnum(temp))
|
||||
year_offset = temp
|
||||
else if (!isnull(temp))
|
||||
log_world("map_config year_offset is not a number!")
|
||||
return
|
||||
|
||||
if ("minetype" in json)
|
||||
minetype = json["minetype"]
|
||||
|
||||
if ("maptype" in json)
|
||||
maptype = json["maptype"]
|
||||
|
||||
if ("announcertype" in json)
|
||||
announcertype = json["announcertype"]
|
||||
|
||||
allow_custom_shuttles = json["allow_custom_shuttles"] != FALSE
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
|
||||
/datum/status_effect/belligerent/proc/do_movement_toggle(force_damage)
|
||||
var/number_legs = owner.get_num_legs(FALSE)
|
||||
if(iscarbon(owner) && !is_servant_of_ratvar(owner) && !owner.anti_magic_check() && number_legs)
|
||||
if(iscarbon(owner) && !is_servant_of_ratvar(owner) && !owner.anti_magic_check(chargecost = 0) && number_legs)
|
||||
if(force_damage || owner.m_intent != MOVE_INTENT_WALK)
|
||||
if(GLOB.ratvar_awakens)
|
||||
owner.Knockdown(20)
|
||||
@@ -248,7 +248,7 @@
|
||||
if(owner.confused)
|
||||
owner.confused = 0
|
||||
severity = 0
|
||||
else if(!owner.anti_magic_check() && owner.stat != DEAD && severity)
|
||||
else if(!owner.anti_magic_check(chargecost = 0) && owner.stat != DEAD && severity)
|
||||
var/static/hum = get_sfx('sound/effects/screech.ogg') //same sound for every proc call
|
||||
if(owner.getToxLoss() > MANIA_DAMAGE_TO_CONVERT)
|
||||
if(is_eligible_servant(owner))
|
||||
|
||||
Reference in New Issue
Block a user