@@ -115,6 +115,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th
|
||||
var/nonabstract_req = 0 //spell can only be cast by mobs that are physical entities
|
||||
var/stat_allowed = 0 //see if it requires being conscious/alive, need to set to 1 for ghostpells
|
||||
var/phase_allowed = 0 // If true, the spell can be cast while phased, eg. blood crawling, ethereal jaunting
|
||||
var/antimagic_allowed = TRUE // If false, the spell cannot be cast while under the effect of antimagic
|
||||
var/invocation = "HURP DURP" //what is uttered when the wizard casts the spell
|
||||
var/invocation_emote_self = null
|
||||
var/invocation_type = "none" //can be none, whisper, emote and shout
|
||||
@@ -147,27 +148,36 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th
|
||||
if(player_lock)
|
||||
if(!user.mind || !(src in user.mind.spell_list) && !(src in user.mob_spell_list))
|
||||
to_chat(user, "<span class='warning'>You shouldn't have this spell! Something's wrong.</span>")
|
||||
return 0
|
||||
return FALSE
|
||||
else
|
||||
if(!(src in user.mob_spell_list))
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
var/turf/T = get_turf(user)
|
||||
if(is_centcom_level(T.z) && !centcom_cancast) //Certain spells are not allowed on the centcom zlevel
|
||||
to_chat(user, "<span class='notice'>You can't cast this spell here.</span>")
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(!skipcharge)
|
||||
if(!charge_check(user))
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(user.stat && !stat_allowed)
|
||||
to_chat(user, "<span class='notice'>Not when you're incapacitated.</span>")
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(!antimagic_allowed)
|
||||
var/antimagic = user.anti_magic_check(TRUE, FALSE, chargecost = 0, self = TRUE)
|
||||
if(antimagic)
|
||||
if(isitem(antimagic))
|
||||
to_chat(user, "<span class='notice'>[antimagic] is interfering with your magic.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>Magic seems to flee from you, you can't gather enough power to cast this spell.</span>")
|
||||
return FALSE
|
||||
|
||||
if(!phase_allowed && istype(user.loc, /obj/effect/dummy))
|
||||
to_chat(user, "<span class='notice'>[name] cannot be cast unless you are completely manifested in the material plane.</span>")
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(ishuman(user))
|
||||
|
||||
@@ -175,7 +185,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th
|
||||
|
||||
if((invocation_type == "whisper" || invocation_type == "shout") && !H.can_speak_vocal())
|
||||
to_chat(user, "<span class='notice'>You can't get the words out!</span>")
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
var/list/casting_clothes = typecacheof(list(/obj/item/clothing/suit/wizrobe,
|
||||
/obj/item/clothing/suit/space/hardsuit/wizard,
|
||||
@@ -187,24 +197,24 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th
|
||||
if(clothes_req) //clothes check
|
||||
if(!is_type_in_typecache(H.wear_suit, casting_clothes))
|
||||
to_chat(H, "<span class='notice'>I don't feel strong enough without my robe.</span>")
|
||||
return 0
|
||||
return FALSE
|
||||
if(!is_type_in_typecache(H.head, casting_clothes))
|
||||
to_chat(H, "<span class='notice'>I don't feel strong enough without my hat.</span>")
|
||||
return 0
|
||||
return FALSE
|
||||
if(cult_req) //CULT_REQ CLOTHES CHECK
|
||||
if(!istype(H.wear_suit, /obj/item/clothing/suit/magusred) && !istype(H.wear_suit, /obj/item/clothing/suit/space/hardsuit/cult))
|
||||
to_chat(H, "<span class='notice'>I don't feel strong enough without my armor.</span>")
|
||||
return 0
|
||||
return FALSE
|
||||
if(!istype(H.head, /obj/item/clothing/head/magus) && !istype(H.head, /obj/item/clothing/head/helmet/space/hardsuit/cult))
|
||||
to_chat(H, "<span class='notice'>I don't feel strong enough without my helmet.</span>")
|
||||
return 0
|
||||
return FALSE
|
||||
else
|
||||
if(clothes_req || human_req)
|
||||
to_chat(user, "<span class='notice'>This spell can only be cast by humans!</span>")
|
||||
return 0
|
||||
return FALSE
|
||||
if(nonabstract_req && (isbrain(user) || ispAI(user)))
|
||||
to_chat(user, "<span class='notice'>This spell can only be cast by physical beings!</span>")
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
|
||||
if(!skipcharge)
|
||||
@@ -499,6 +509,9 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th
|
||||
if(user.stat && !stat_allowed)
|
||||
return FALSE
|
||||
|
||||
if(!antimagic_allowed && user.anti_magic_check(TRUE, FALSE, chargecost = 0, self = TRUE))
|
||||
return FALSE
|
||||
|
||||
if(!ishuman(user))
|
||||
if(clothes_req || human_req)
|
||||
return FALSE
|
||||
|
||||
@@ -20,8 +20,11 @@
|
||||
after_cast(targets)
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/area_teleport/before_cast(list/targets)
|
||||
var/A = null
|
||||
|
||||
var/area/U = get_area(usr)
|
||||
if(U.noteleport && !istype(U, /area/wizard_station)) // Wizard den special check for those complaining about being unable to tele on station.
|
||||
to_chat(usr, "<span class='warning'>Unseen forces prevent you from casting this spell in this area</span>")
|
||||
return
|
||||
var/A
|
||||
if(!randomise_selection)
|
||||
A = input("Area to teleport to", "Teleport", A) as null|anything in GLOB.teleportlocs
|
||||
else
|
||||
@@ -53,12 +56,13 @@
|
||||
if(target && target.buckled)
|
||||
target.buckled.unbuckle_mob(target, force=1)
|
||||
|
||||
var/forcecheck = istype(get_area(target), /area/wizard_station)
|
||||
var/list/tempL = L
|
||||
var/attempt = null
|
||||
var/success = 0
|
||||
while(tempL.len)
|
||||
attempt = pick(tempL)
|
||||
do_teleport(target, attempt, channel = TELEPORT_CHANNEL_MAGIC)
|
||||
do_teleport(target, attempt, channel = TELEPORT_CHANNEL_MAGIC, forced = forcecheck)
|
||||
if(get_turf(target) == attempt)
|
||||
success = 1
|
||||
break
|
||||
@@ -66,7 +70,7 @@
|
||||
tempL.Remove(attempt)
|
||||
|
||||
if(!success)
|
||||
do_teleport(target, L, forceMove = TRUE, channel = TELEPORT_CHANNEL_MAGIC)
|
||||
do_teleport(target, L, forceMove = TRUE, channel = TELEPORT_CHANNEL_MAGIC, forced = forcecheck)
|
||||
playsound(get_turf(user), sound2, 50,1)
|
||||
|
||||
return
|
||||
@@ -83,6 +87,6 @@
|
||||
else
|
||||
playsound(user.loc, pick('sound/misc/null.ogg','sound/misc/null.ogg'), 100, 1)
|
||||
if("whisper")
|
||||
user.whisper("[invocation] [uppertext(chosenarea.name)]", forced = "spell")
|
||||
user.whisper("[invocation] [uppertext(chosenarea.name)]")
|
||||
|
||||
return
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
clothes_req = 0
|
||||
invocation = "none"
|
||||
invocation_type = "none"
|
||||
proj_type = /obj/effect/proc_holder/spell/targeted/inflict_handler/magic_missile/lesser
|
||||
proj_type = "/obj/effect/proc_holder/spell/targeted/inflict_handler/magic_missile/lesser"
|
||||
proj_lifespan = 10
|
||||
max_targets = 6
|
||||
action_icon_state = "magicm"
|
||||
|
||||
@@ -35,6 +35,6 @@
|
||||
return TRUE
|
||||
if(ismob(mover))
|
||||
var/mob/M = mover
|
||||
if(M.anti_magic_check())
|
||||
if(M.anti_magic_check(chargecost = 0))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
if(!amt_knockdown && amt_dam_stam)
|
||||
target.adjustStaminaLoss(amt_dam_stam)
|
||||
else
|
||||
target.Knockdown(amt_knockdown, override_hardstun = amt_hardstun, amt_dam_stam)
|
||||
target.Knockdown(amt_knockdown, override_hardstun = amt_hardstun, override_stamdmg = amt_dam_stam)
|
||||
target.Unconscious(amt_unconscious)
|
||||
target.Stun(amt_stun)
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ Also, you never added distance checking after target is selected. I've went ahea
|
||||
return
|
||||
|
||||
var/datum/mind/TM = target.mind
|
||||
if((target.anti_magic_check() || TM.has_antag_datum(/datum/antagonist/wizard) || TM.has_antag_datum(/datum/antagonist/cult) || TM.has_antag_datum(/datum/antagonist/clockcult) || TM.has_antag_datum(/datum/antagonist/changeling) || TM.has_antag_datum(/datum/antagonist/rev)) || cmptext(copytext(target.key,1,2),"@"))
|
||||
if((target.anti_magic_check(TRUE, FALSE) || TM.has_antag_datum(/datum/antagonist/wizard) || TM.has_antag_datum(/datum/antagonist/cult) || TM.has_antag_datum(/datum/antagonist/clockcult) || TM.has_antag_datum(/datum/antagonist/changeling) || TM.has_antag_datum(/datum/antagonist/rev)) || cmptext(copytext(target.key,1,2),"@"))
|
||||
if(!silent)
|
||||
to_chat(user, "<span class='warning'>[target.p_their(TRUE)] mind is resisting your spell!</span>")
|
||||
return
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
var/revert_on_death = TRUE
|
||||
var/die_with_shapeshifted_form = TRUE
|
||||
var/convert_damage = FALSE //If you want to convert the caster's health to the shift, and vice versa.
|
||||
var/convert_damage = TRUE //If you want to convert the caster's health to the shift, and vice versa.
|
||||
var/convert_damage_type = BRUTE //Since simplemobs don't have advanced damagetypes, what to convert damage back into.
|
||||
var/shapeshift_type
|
||||
var/list/possible_shapes = list(/mob/living/simple_animal/mouse,\
|
||||
@@ -101,8 +101,10 @@
|
||||
stored.forceMove(src)
|
||||
stored.notransform = TRUE
|
||||
if(source.convert_damage)
|
||||
var/damapply = (stored.maxHealth - (stored.health + stored.maxHealth)/2) //Carbons go from -100 to 100 naturally, while simplemobs only go from 0 to 100. Can't do a direct conversion.
|
||||
shape.apply_damage(damapply, source.convert_damage_type)
|
||||
var/damage_percent = (stored.maxHealth - stored.health)/stored.maxHealth;
|
||||
var/damapply = damage_percent * shape.maxHealth;
|
||||
|
||||
shape.apply_damage(damapply, source.convert_damage_type, forced = TRUE);
|
||||
slink = soullink(/datum/soullink/shapeshift, stored , shape)
|
||||
slink.source = src
|
||||
|
||||
@@ -152,8 +154,10 @@
|
||||
stored.death()
|
||||
else if(source.convert_damage)
|
||||
stored.revive(full_heal = TRUE)
|
||||
var/damapply = (shape.maxHealth - 2*shape.health) //Since we halved incoming damage, double outgoing.
|
||||
stored.apply_damage(damapply, source.convert_damage_type)
|
||||
var/damage_percent = (shape.maxHealth - shape.health)/shape.maxHealth;
|
||||
var/damapply = stored.maxHealth * damage_percent
|
||||
|
||||
stored.apply_damage(damapply, source.convert_damage_type, forced = TRUE)
|
||||
qdel(shape)
|
||||
qdel(src)
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
/obj/effect/cross_action/spacetime_dist/proc/walk_link(atom/movable/AM)
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
if(M.anti_magic_check())
|
||||
if(M.anti_magic_check(chargecost = 0))
|
||||
return
|
||||
if(linked_dist && walks_left > 0)
|
||||
flick("purplesparkles", src)
|
||||
|
||||
@@ -61,6 +61,10 @@
|
||||
organ.Remove(organ.owner)
|
||||
else
|
||||
while(!isturf(item_to_retrieve.loc) && infinite_recursion < 10) //if it's in something you get the whole thing.
|
||||
if(isitem(item_to_retrieve.loc))
|
||||
var/obj/item/I = item_to_retrieve.loc
|
||||
if(I.item_flags & ABSTRACT) //Being able to summon abstract things because your item happened to get placed there is a no-no
|
||||
break
|
||||
if(ismob(item_to_retrieve.loc)) //If its on someone, properly drop it
|
||||
var/mob/M = item_to_retrieve.loc
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/obj/effect/proc_holder/spell/targeted/telepathy
|
||||
name = "Telepathy"
|
||||
desc = "Telepathically transmits a message to the target."
|
||||
charge_max = 0
|
||||
clothes_req = 0
|
||||
range = 7
|
||||
include_user = 0
|
||||
action_icon = 'icons/mob/actions/actions_revenant.dmi'
|
||||
action_icon_state = "r_transmit"
|
||||
action_background_icon_state = "bg_spell"
|
||||
var/notice = "notice"
|
||||
var/boldnotice = "boldnotice"
|
||||
var/magic_check = FALSE
|
||||
var/holy_check = FALSE
|
||||
var/tinfoil_check = TRUE
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/telepathy/cast(list/targets, mob/living/user = usr)
|
||||
for(var/mob/living/M in targets)
|
||||
var/msg = stripped_input(usr, "What do you wish to tell [M]?", null, "")
|
||||
if(!msg)
|
||||
charge_counter = charge_max
|
||||
return
|
||||
log_directed_talk(user, M, msg, LOG_SAY, "[name]")
|
||||
to_chat(user, "<span class='[boldnotice]'>You transmit to [M]:</span> <span class='[notice]'>[msg]</span>")
|
||||
if(!M.anti_magic_check(magic_check, holy_check, tinfoil_check, 0)) //hear no evil
|
||||
to_chat(M, "<span class='[boldnotice]'>You hear something behind you talking...</span> <span class='[notice]'>[msg]</span>")
|
||||
for(var/ded in GLOB.dead_mob_list)
|
||||
if(!isobserver(ded))
|
||||
continue
|
||||
var/follow_rev = FOLLOW_LINK(ded, user)
|
||||
var/follow_whispee = FOLLOW_LINK(ded, M)
|
||||
to_chat(ded, "[follow_rev] <span class='[boldnotice]'>[user] [name]:</span> <span class='[notice]'>\"[msg]\" to</span> [follow_whispee] <span class='name'>[M]</span>")
|
||||
Reference in New Issue
Block a user