Miming Refactor

This commit is contained in:
Fox-McCloud
2016-02-28 22:40:00 -05:00
parent 38075f4beb
commit e2bb00a5b1
15 changed files with 103 additions and 68 deletions
+1
View File
@@ -53,6 +53,7 @@
var/has_been_rev = 0//Tracks if this mind has been a rev or not
var/miming = 0 // Mime's vow of silence
var/datum/faction/faction //associated faction
var/datum/changeling/changeling //changeling holder
var/datum/vampire/vampire //vampire holder
+6 -1
View File
@@ -19,6 +19,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
var/charge_max = 100 //recharge time in deciseconds if charge_type = "recharge" or starting charges if charge_type = "charges"
var/charge_counter = 0 //can only cast spells if it equals recharge, ++ each decisecond if charge_type = "recharge" or -- each cast if charge_type = "charges"
var/still_recharging_msg = "<span class='notice'>The spell is still recharging.</span>"
var/holder_var_type = "bruteloss" //only used if charge_type equals to "holder_var"
var/holder_var_amount = 20 //same. The amount adjusted with the mob's var when the spell is used
@@ -27,6 +28,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
var/clothes_req = 1 //see if it requires clothes
var/stat_allowed = 0 //see if it requires being conscious/alive, need to set to 1 for ghostpells
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 and shout
var/range = 7 //the range of the spell; outer radius for aoe spells
var/message = "" //whatever it says to the guy affected by it
@@ -74,7 +76,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
switch(charge_type)
if("recharge")
if(charge_counter < charge_max)
user << "<span class='notice'>[name] is still recharging.</span>"
user << still_recharging_msg
return 0
if("charges")
if(!charge_counter)
@@ -128,10 +130,13 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
user.whisper(invocation)
else
user.whisper(replacetext(invocation," ","`"))
if("emote")
user.visible_message(invocation, invocation_emote_self) //same style as in mob/living/emote.dm
/obj/effect/proc_holder/spell/New()
..()
still_recharging_msg = "<span class='notice'>[name] is still recharging.</span>"
charge_counter = charge_max
/obj/effect/proc_holder/spell/Destroy()
+59
View File
@@ -0,0 +1,59 @@
/obj/effect/proc_holder/spell/aoe_turf/conjure/mime_wall
name = "Invisible wall"
desc = "The mime's performance transmutates into physical reality."
school = "mime"
panel = "Mime"
summon_type = list(/obj/effect/forcefield/mime)
invocation_type = "emote"
invocation_emote_self = "<span class='notice'>You form a wall in front of yourself.</span>"
summon_lifespan = 300
charge_max = 300
clothes_req = 0
range = 0
action_icon_state = "mime"
action_background_icon_state = "bg_mime"
/obj/effect/proc_holder/spell/aoe_turf/conjure/mime_wall/Click()
if(usr && usr.mind)
if(!usr.mind.miming)
usr << "<span class='notice'>You must dedicate yourself to silence first.</span>"
return
invocation = "<B>[usr.real_name]</B> looks as if a wall is in front of them."
else
invocation_type ="none"
..()
/obj/effect/proc_holder/spell/targeted/mime/speak
name = "Speech"
desc = "Make or break a vow of silence."
school = "mime"
panel = "Mime"
clothes_req = 0
charge_max = 3000
range = -1
include_user = 1
action_icon_state = "mime"
action_background_icon_state = "bg_mime"
/obj/effect/proc_holder/spell/targeted/mime/speak/Click()
if(!usr)
return
if(!ishuman(usr))
return
var/mob/living/carbon/human/H = usr
if(H.mind.miming)
still_recharging_msg = "<span class='warning'>You can't break your vow of silence that fast!</span>"
else
still_recharging_msg = "<span class='warning'>You'll have to wait before you can give your vow of silence again!</span>"
..()
/obj/effect/proc_holder/spell/targeted/mime/speak/cast(list/targets,mob/user = usr)
for(var/mob/living/carbon/human/H in targets)
H.mind.miming=!H.mind.miming
if(H.mind.miming)
H << "<span class='notice'>You make a vow of silence.</span>"
else
H << "<span class='notice'>You break your vow of silence.</span>"