Skip to content

Commit

Permalink
Now wizard can communicate with constructs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Forgotten312 authored and HunterMaksim committed Jul 26, 2016
2 parents b07f657 + 858e899 commit 9c9af83
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
58 changes: 58 additions & 0 deletions code/game/gamemodes/wizard/white_only.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/proc/is_servant_of_wizard(mob/living/U, mob/living/M)
for(var/R in M.faction)
if(R == U)
return M && istype(M) && M.mind
else
for(var/RM in U.faction)
if(RM == R && RM != "neutral" && R != "neutral")
return M && istype(M) && M.mind
return 0

/datum/action/innate/wizardcomm
name = "Communion"
button_icon_state = "cult_comms"
background_icon_state = "bg_demon"
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_CONSCIOUS

/datum/action/innate/wizardcomm/IsAvailable()
return ..()

/datum/action/innate/wizardcomm/Activate()
var/input = sanitize_russian(stripped_input(usr, "Please choose a message to tell to the constructs and wizard.", "Voice of Magic", ""))
if(!input || !IsAvailable())
return

wizard_commune(usr, input)
return

/proc/wizard_commune(mob/living/user, message)
if(!message)
return
sleep(10)
if(!user)
return
if(!ishuman(user))
user.say(message)
else
user.whisper(message)
var/my_message = "<span class='purple'><b>[(ishuman(user) ? "Wizard" : "Construct")] [user]:</b> [message]</span>"
for(var/mob/M in mob_list)
if(is_servant_of_wizard(user, M))
M << my_message
else if(M in dead_mob_list)
var/link = FOLLOW_LINK(M, user)
M << "[link] [my_message]"

log_say("[user.real_name]/[user.key] : [message]")

/datum/spellbook_entry/item/soulstones/Buy(mob/living/carbon/human/user,obj/item/weapon/spellbook/book)
. =..()
if(.)
var/datum/action/innate/wizardcomm/W = new()
W.Grant(user.mind.current)
user.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/conjure/soulstone(null))
return .

/datum/spellbook_entry/item/soulstones
cost = 3
limit = 1
2 changes: 1 addition & 1 deletion code/game/verbs/reimu_hakkureis_donations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Owl Mask:/obj/item/clothing/mask/gas/owl_mask:180
Personal Stuff
Eye patch:/obj/item/clothing/glasses/eyepatch:130
Cane:/obj/item/weapon/cane:130
Zippo:/obj/item/weapon/lighter/zippo:130
Zippo:/obj/item/weapon/lighter:130
Cigarette packet:/obj/item/weapon/storage/fancy/cigarettes:20
DromedaryCo packet:/obj/item/weapon/storage/fancy/cigarettes/dromedaryco:50
Premium Havanian Cigar:/obj/item/clothing/mask/cigarette/cigar/havana:130
Expand Down
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@
#include "code\game\gamemodes\wizard\raginmages.dm"
#include "code\game\gamemodes\wizard\soulstone.dm"
#include "code\game\gamemodes\wizard\spellbook.dm"
#include "code\game\gamemodes\wizard\white_only.dm"
#include "code\game\gamemodes\wizard\wizard.dm"
#include "code\game\machinery\ai_slipper.dm"
#include "code\game\machinery\airlock_control.dm"
Expand Down

0 comments on commit 9c9af83

Please sign in to comment.