Skip to content

Commit

Permalink
Merge branch 'master' into Sec_record_photo
Browse files Browse the repository at this point in the history
  • Loading branch information
Lobachevskiy committed Jan 21, 2015
2 parents 3619ed4 + 11f3717 commit 21773c0
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 2 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/hud.dm
Expand Up @@ -24,3 +24,4 @@
#define ANTAG_HUD_OPS 7
#define ANTAG_HUD_GANG_A 8
#define ANTAG_HUD_GANG_B 9
#define ANTAG_HUD_WIZ 10
1 change: 1 addition & 0 deletions code/datums/hud.dm
Expand Up @@ -11,6 +11,7 @@ var/datum/atom_hud/huds = list( \
ANTAG_HUD_OPS = new/datum/atom_hud/antag(), \
ANTAG_HUD_GANG_A = new/datum/atom_hud/antag(), \
ANTAG_HUD_GANG_B = new/datum/atom_hud/antag(), \
ANTAG_HUD_WIZ = new/datum/atom_hud/antag(), \
)

/datum/atom_hud
Expand Down
3 changes: 3 additions & 0 deletions code/game/gamemodes/antag_spawner.dm
Expand Up @@ -58,6 +58,8 @@
src.used = 1
var/client/C = pick(candidates)
spawn_antag(C, get_turf(H.loc), href_list["school"])
if(H.mind)
ticker.mode.update_wiz_icons_added(H.mind)
else
H << "Unable to reach your apprentice! You can either attack the spellbook with the contract to refund your points, or wait and try again later."

Expand Down Expand Up @@ -103,6 +105,7 @@
M.mind.objectives += new_objective
ticker.mode.traitors += M.mind
M.mind.special_role = "apprentice"
ticker.mode.update_wiz_icons_added(M.mind)
M << sound('sound/effects/magic.ogg')

/obj/item/weapon/antag_spawner/contract/equip_antag(mob/target as mob)
Expand Down
1 change: 1 addition & 0 deletions code/game/gamemodes/wizard/raginmages.dm
Expand Up @@ -2,6 +2,7 @@
name = "ragin' mages"
config_tag = "raginmages"
required_players = 20
use_huds = 1
var/max_mages = 0
var/making_mage = 0
var/mages_made = 1
Expand Down
17 changes: 16 additions & 1 deletion code/game/gamemodes/wizard/wizard.dm
Expand Up @@ -9,7 +9,7 @@
required_enemies = 1
recommended_enemies = 1
pre_setup_before_jobs = 1

var/use_huds = 0
var/finished = 0

/datum/game_mode/wizard/announce()
Expand Down Expand Up @@ -40,6 +40,8 @@
equip_wizard(wizard.current)
name_wizard(wizard.current)
greet_wizard(wizard)
if(use_huds)
update_wiz_icons_added(wizard)
..()
return

Expand Down Expand Up @@ -276,5 +278,18 @@ Made a proc so this is not repeated 14 (or more) times.*/
else
return 1


/proc/iswizard(mob/living/M as mob)
return istype(M) && M.mind && ticker && ticker.mode && (M.mind in ticker.mode.wizards)


/datum/game_mode/proc/update_wiz_icons_added(datum/mind/wiz_mind)
var/datum/atom_hud/antag/wizhud = huds[ANTAG_HUD_WIZ]
wizhud.join_hud(wiz_mind.current)
set_antag_hud(wiz_mind.current, ((wiz_mind in wizards) ? "wizard" : "apprentice"))


/datum/game_mode/proc/update_wiz_icons_removed(datum/mind/wiz_mind)
var/datum/atom_hud/antag/wizhud = huds[ANTAG_HUD_WIZ]
wizhud.leave_hud(wiz_mind.current)
set_antag_hud(wiz_mind.current, null)
3 changes: 3 additions & 0 deletions code/game/objects/items/devices/violin.dm
Expand Up @@ -19,6 +19,9 @@
..()

/obj/item/device/violin/attack_self(mob/user as mob)
if(!user.IsAdvancedToolUser())
user << "<span class='danger'>You don't have the dexterity to do this!</span>"
return 1
interact(user)

/obj/item/device/violin/interact(mob/user as mob)
Expand Down
6 changes: 6 additions & 0 deletions code/game/objects/structures/musician.dm
Expand Up @@ -323,8 +323,14 @@
..()

/obj/structure/piano/attack_hand(mob/user as mob)
if(!user.IsAdvancedToolUser())
user << "<span class='danger'>You don't have the dexterity to do this!</span>"
return 1
interact(user)

/obj/structure/piano/attack_paw(mob/user as mob)
return src.attack_hand(user)

/obj/structure/piano/interact(mob/user as mob)
if(!user || !anchored)
return
Expand Down
5 changes: 5 additions & 0 deletions code/game/objects/structures/tank_dispenser.dm
Expand Up @@ -31,8 +31,13 @@
if(1 to 4) overlays += "plasma-[plasmatanks]"
if(5 to INFINITY) overlays += "plasma-5"

/obj/structure/dispenser/attack_paw(mob/user as mob)
return src.attack_hand(user)

/obj/structure/dispenser/attack_hand(mob/user as mob)
if(!user.IsAdvancedToolUser())
user << "<span class='danger'>You don't have the dexterity to do this!</span>"
return 1
user.set_machine(src)
var/dat = "[src]<br><br>"
dat += "Oxygen tanks: [oxygentanks] - [oxygentanks ? "<A href='?src=\ref[src];oxygen=1'>Dispense</A>" : "empty"]<br>"
Expand Down
1 change: 1 addition & 0 deletions code/modules/events/wizard/imposter.dm
Expand Up @@ -45,6 +45,7 @@
protect_objective.target = W.mind
protect_objective.explanation_text = "Protect [W.real_name], the wizard."
I.mind.objectives += protect_objective
ticker.mode.update_wiz_icons_added(I.mind)

I.attack_log += "\[[time_stamp()]\] <font color='red'>Is an imposter!</font>"
I << "<B>You are an imposter! Trick and confuse the crew to misdirect malice from your handsome original!</B>"
Expand Down
2 changes: 1 addition & 1 deletion data/mode.txt
@@ -1 +1 @@
extended
extended
Binary file modified icons/mob/hud.dmi
Binary file not shown.

0 comments on commit 21773c0

Please sign in to comment.