Macros for antags

may need some testing and reviewing
This commit is contained in:
Unfit
2015-02-18 22:32:31 +01:00
parent b97b6f75fb
commit 9fe182db60
9 changed files with 57 additions and 31 deletions

View File

@@ -86,3 +86,31 @@
#define iscrowbar(A) istype(A, /obj/item/weapon/crowbar)
#define iswire(O) istype(O, /obj/item/stack/cable_coil)
//Macros for antags
#define isvampire(H) ((H.mind in ticker.mode.vampires) || H.mind.vampire)
#define iscult(H) (H.mind in ticker.mode.cult)
#define isculthead(H) iscult(H)&&(H.mind in ticker.mode.modePlayer)
#define ischangeling(H) (H.mind in ticker.mode.changelings)
#define isrev(H) (H.mind in ticker.mode.revolutionaries)
#define isrevhead(H) (H.mind in ticker.mode.head_revolutionaries)
#define istraitor(H) (H.mind in ticker.mode.traitors)
#define ismalf(H) (H.mind in ticker.mode.malf_ai)
#define isnukeop(H) (H.mind in ticker.mode.syndicates)
#define iswizard(H) (H.mind in ticker.mode.wizards)
#define isborer(H) (H.mind in ticker.mode.borers)
#define isbadmonkey(H) ((/datum/disease/jungle_fever in H.viruses) || M.mind in ticker.mode.infected_monkeys)
#define isdeathsquad(H) (M.mind in ticker.mode.deathsquads)

View File

@@ -18,7 +18,7 @@
if(targetarea && targetarea.anti_ethereal && !isAdminGhost(usr))
usr << "<span class='sinister'>A dark forcefield prevents you from entering the area.<span>"
else
if(targetloc.holy && ((src.invisibility == 0) || (src.mind in ticker.mode.cult)))
if(targetloc.holy && ((src.invisibility == 0) || iscult(src)))
usr << "<span class='warning'>These are sacred grounds, you cannot go there!</span>"
else
loc = targetloc

View File

@@ -1,5 +1,5 @@
/proc/iswizard(mob/living/M as mob)
return istype(M) && M.mind && ticker && ticker.mode && (M.mind in ticker.mode.wizards)
/*/proc/iswizard(mob/living/M as mob)
return istype(M) && M.mind && ticker && ticker.mode && (M.mind in ticker.mode.wizards)*/ //See _macros.dm
/datum/game_mode
var/list/datum/mind/wizards = list()

View File

@@ -83,7 +83,7 @@
Subject.Weaken(10)
flick("e_flash", Subject.flash)
if(ishuman(user) && user.mind && user.mind in ticker.mode.head_revolutionaries) // alien revhead when?
if(user.mind && isrevhead(user)) // alien revhead when?
if(ishuman(Subject))
if(Subject.stat != DEAD)
Subject.mind_initialize() // give them a mind datum if they don't have one

View File

@@ -81,7 +81,7 @@
if(M.mind && (M.mind.assigned_role == "Chaplain"))
user << "\red You can't heal yourself!"
return
if((M.mind in ticker.mode.cult && !(M.mind in ticker.mode.modePlayer)) && (prob(20))) // can't deconvert originals - Pomf
if((iscult(M) && !isculthead(M)) && (prob(20))) // can't deconvert originals - Pomf
M << "\red The power of [src.deity_name] clears your mind of heresy!"
user << "\red You see how [M]'s eyes become clear, the cult no longer holds control over him!"
ticker.mode.remove_cultist(M.mind)

View File

@@ -14,7 +14,7 @@
if(ishuman(user))
var/mob/living/carbon/human/H = user
if((H.mind in ticker.mode.vampires) || H.mind.vampire) //if vampire
if(isvampire(H))
if(!(VAMP_FULL in H.mind.vampire.powers))
H << "<span class='notice'>You don't see anything.</span>"
return

View File

@@ -1036,37 +1036,35 @@ var/global/floorIsLava = 0
return 0
if (!istype(M))
return 0
if((M.mind in ticker.mode.head_revolutionaries) || (M.mind in ticker.mode.revolutionaries))
if(isrev(M) || isrevhead(M))
if (ticker.mode.config_tag == "revolution")
return 2
return 1
if(M.mind in ticker.mode.cult)
if(iscult(M))
if (ticker.mode.config_tag == "cult")
return 2
return 1
if(M.mind in ticker.mode.malf_ai)
if(ismalf(M))
if (ticker.mode.config_tag == "malfunction")
return 2
return 1
if(M.mind in ticker.mode.syndicates)
if(isnukeop(M))
if (ticker.mode.config_tag == "nuclear")
return 2
return 1
if(M.mind in ticker.mode.wizards)
if(iswizard(M))
if (ticker.mode.config_tag == "wizard")
return 2
return 1
if(M.mind in ticker.mode.changelings)
if(ischangeling(M))
if (ticker.mode.config_tag == "changeling")
return 2
return 1
if(M.mind in ticker.mode.borers)
if(isborer(M))
if (ticker.mode.config_tag == "borer")
return 2
return 1
for(var/datum/disease/D in M.viruses)
if(istype(D, /datum/disease/jungle_fever))
if(isbadmonkey(M))
if (ticker.mode.config_tag == "monkey")
return 2
return 1

View File

@@ -116,7 +116,7 @@ client/proc/antag_madness(var/mob/M in mob_list)
switch(choice)
if("traitor")
if(M.mind in ticker.mode.traitors) return 0
if(istraitor(M)) return 0
ticker.mode.traitors += M.mind
M.mind.special_role = "traitor"
ticker.mode.forge_traitor_objectives(M.mind)
@@ -157,7 +157,7 @@ client/proc/antag_madness(var/mob/M in mob_list)
if("changeling")
if(M.mind in ticker.mode.changelings) return 0
if(ischangeling(M)) return 0
ticker.mode.changelings += M.mind
ticker.mode.grant_changeling_powers(M)
M.mind.special_role = "Changeling"
@@ -170,7 +170,7 @@ client/proc/antag_madness(var/mob/M in mob_list)
if("vampire")
if(M.mind in ticker.mode.vampires) return 0
if(isvampire(M)) return 0
ticker.mode.vampires += M.mind
ticker.mode.grant_vampire_powers(M)
M.mind.special_role = "Vampire"
@@ -211,7 +211,7 @@ client/proc/antag_madness(var/mob/M in mob_list)
if("cult")
if(M.mind in ticker.mode.cult) return 0
if(iscult(M)) return 0
ticker.mode.cult += M.mind
ticker.mode.update_cult_icons_added(M.mind)
M.mind.special_role = "Cultist"
@@ -308,7 +308,7 @@ client/proc/antag_madness(var/mob/M in mob_list)
if("rev")
if(M.mind in ticker.mode.head_revolutionaries) return 0
if(isrevhead(M)) return 0
ticker.mode.head_revolutionaries += M.mind
ticker.mode.update_rev_icons_added(M.mind)
M.mind.special_role = "Head Revolutionary"
@@ -352,7 +352,7 @@ client/proc/antag_madness(var/mob/M in mob_list)
if("nuke")
if(M.mind in ticker.mode.syndicates) return 0
if(isnukeop(M)) return 0
ticker.mode.syndicates += M.mind
ticker.mode.update_synd_icons_added(M.mind)
M.real_name = "[syndicate_name()] Operative"
@@ -397,7 +397,7 @@ client/proc/antag_madness(var/mob/M in mob_list)
if("deathsquad")
if(M.mind in ticker.mode.deathsquads) return 0
if(isdeathsquad(M)) return 0
M.mind.assigned_role = "MODE"
M.mind.special_role = "Death Commando"
ticker.mode.deathsquads += M.mind
@@ -458,7 +458,7 @@ client/proc/antag_madness(var/mob/M in mob_list)
if("wizard")
if(M.mind in ticker.mode.wizards) return 0
if(iswizard(M)) return 0
ticker.mode.wizards += M.mind
M.mind.special_role = "Wizard"
M.mind.assigned_role = "MODE"
@@ -548,7 +548,7 @@ client/proc/antag_madness(var/mob/M in mob_list)
if("monkey")
if(M.monkeyizing) return 0
if(M.mind in ticker.mode.infected_monkeys) return 0
if(isbadmonkey(M)) return 0
ticker.mode.infected_monkeys += M.mind
var/mob/living/carbon/human/H = M
var/mob/living/carbon/monkey/K = M

View File

@@ -678,13 +678,13 @@
if(!holder) return
if(ishuman(M))
if((M.mind in ticker.mode.cult) && !(M.mind in ticker.mode.modePlayer) && prob(10))
if(iscult(M) && !isculthead(M) && prob(10))
M << "<span class='notice'>A cooling sensation from inside you brings you an untold calmness.</span>"
ticker.mode.remove_cultist(M.mind)
for(var/mob/O in viewers(M, null))
O.show_message(text("<span class='notice'>[]'s eyes blink and become clearer.</span>", M), 1) // So observers know it worked.
// Vamps react to this like acid
if(((M.mind in ticker.mode.vampires) || M.mind.vampire) && prob(10))
if(isvampire(M) && prob(10))
if(!(VAMP_FULL in M.mind.vampire.powers))
if(!M) M = holder.my_atom
M.adjustToxLoss(1*REM)
@@ -694,7 +694,7 @@
/datum/reagent/holywater/reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)//Splashing people with water can help put them out!
// Vamps react to this like acid
if(ishuman(M))
if((M.mind in ticker.mode.vampires))
if(isvampire(M))
if(!(VAMP_FULL in M.mind.vampire.powers))
var/mob/living/carbon/human/H=M
if(method == TOUCH)