-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathmonsterhunter.dm
163 lines (139 loc) · 6.85 KB
/
monsterhunter.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#define HUNTER_SCAN_MIN_DISTANCE 8
#define HUNTER_SCAN_MAX_DISTANCE 15
/// 5s update time
#define HUNTER_SCAN_PING_TIME 20
/datum/antagonist/monsterhunter
name = "\improper Monster Hunter"
roundend_category = "Monster Hunters"
antagpanel_category = "Monster Hunter"
job_rank = ROLE_MONSTERHUNTER
antag_hud_name = "monsterhunter"
preview_outfit = /datum/outfit/monsterhunter
var/list/datum/action/powers = list()
var/datum/martial_art/hunterfu/my_kungfu = new
var/give_objectives = TRUE
var/datum/action/cooldown/bloodsucker/trackvamp = new /datum/action/cooldown/bloodsucker/trackvamp()
var/datum/action/cooldown/bloodsucker/fortitude = new /datum/action/cooldown/bloodsucker/fortitude/hunter()
/datum/antagonist/monsterhunter/apply_innate_effects(mob/living/mob_override)
. = ..()
var/mob/living/current_mob = mob_override || owner.current
ADD_TRAIT(current_mob, TRAIT_NOSOFTCRIT, BLOODSUCKER_TRAIT)
ADD_TRAIT(current_mob, TRAIT_NOCRITDAMAGE, BLOODSUCKER_TRAIT)
owner.unconvertable = TRUE
my_kungfu.teach(current_mob, make_temporary = FALSE)
/datum/antagonist/monsterhunter/remove_innate_effects(mob/living/mob_override)
. = ..()
var/mob/living/current_mob = mob_override || owner.current
REMOVE_TRAIT(current_mob, TRAIT_NOSOFTCRIT, BLOODSUCKER_TRAIT)
REMOVE_TRAIT(current_mob, TRAIT_NOCRITDAMAGE, BLOODSUCKER_TRAIT)
owner.unconvertable = FALSE
if(my_kungfu)
my_kungfu.remove(current_mob)
/datum/antagonist/monsterhunter/on_gain()
//Give Monster Hunter powers
trackvamp.Grant(owner.current)
fortitude.Grant(owner.current)
if(give_objectives)
//Give Hunter Objective
var/datum/objective/monsterhunter/monsterhunter_objective = new
monsterhunter_objective.owner = owner
objectives += monsterhunter_objective
//Give Theft Objective
var/datum/objective/steal/steal_objective = new
steal_objective.owner = owner
steal_objective.find_target()
objectives += steal_objective
//Teach Stake crafting
owner.teach_crafting_recipe(/datum/crafting_recipe/hardened_stake)
owner.teach_crafting_recipe(/datum/crafting_recipe/silver_stake)
return ..()
/datum/antagonist/monsterhunter/on_removal()
//Remove Monster Hunter powers
trackvamp.Remove(owner.current)
fortitude.Remove(owner.current)
to_chat(owner.current, span_userdanger("Your hunt has ended: You enter retirement once again, and are no longer a Monster Hunter."))
return ..()
/datum/antagonist/monsterhunter/on_body_transfer(mob/living/old_body, mob/living/new_body)
. = ..()
for(var/datum/action/cooldown/bloodsucker/all_powers as anything in powers)
all_powers.Remove(old_body)
all_powers.Grant(new_body)
/// Mind version
/datum/mind/proc/make_monsterhunter()
var/datum/antagonist/monsterhunter/monsterhunterdatum = has_antag_datum(/datum/antagonist/monsterhunter)
if(!monsterhunterdatum)
monsterhunterdatum = add_antag_datum(/datum/antagonist/monsterhunter)
special_role = ROLE_MONSTERHUNTER
return monsterhunterdatum
/datum/mind/proc/remove_monsterhunter()
var/datum/antagonist/monsterhunter/monsterhunterdatum = has_antag_datum(/datum/antagonist/monsterhunter)
if(monsterhunterdatum)
remove_antag_datum(/datum/antagonist/monsterhunter)
special_role = null
/// Called when using admin tools to give antag status
/datum/antagonist/monsterhunter/admin_add(datum/mind/new_owner, mob/admin)
message_admins("[key_name_admin(admin)] made [key_name_admin(new_owner)] into [name].")
log_admin("[key_name(admin)] made [key_name(new_owner)] into [name].")
new_owner.add_antag_datum(src)
/// Called when removing antagonist using admin tools
/datum/antagonist/monsterhunter/admin_remove(mob/user)
if(!user)
return
message_admins("[key_name_admin(user)] has removed [name] antagonist status from [key_name_admin(owner)].")
log_admin("[key_name(user)] has removed [name] antagonist status from [key_name(owner)].")
on_removal()
/datum/antagonist/monsterhunter/proc/add_objective(datum/objective/added_objective)
objectives += added_objective
/datum/antagonist/monsterhunter/proc/remove_objectives(datum/objective/removed_objective)
objectives -= removed_objective
/datum/antagonist/monsterhunter/greet()
. = ..()
to_chat(owner.current, span_userdanger("After witnessing recent events on the station, we return to your old profession, we are a Monster Hunter!"))
to_chat(owner.current, span_announce("While we can kill anyone in our way to destroy the monsters lurking around, <b>causing property damage is unacceptable</b>."))
to_chat(owner.current, span_announce("However, security WILL detain us if they discover our mission."))
to_chat(owner.current, span_announce("In exchange for our services, it shouldn't matter if a few items are gone missing for our... personal collection."))
owner.current.playsound_local(null, 'sound/effects/his_grace_ascend.ogg', 100, FALSE, pressure_affected = FALSE)
owner.announce_objectives()
//////////////////////////////////////////////////////////////////////////
// Monster Hunter Pinpointer
//////////////////////////////////////////////////////////////////////////
/// TAKEN FROM: /datum/action/changeling/pheromone_receptors // pheromone_receptors.dm for a version of tracking that Changelings have!
/datum/status_effect/agent_pinpointer/hunter_edition
alert_type = /atom/movable/screen/alert/status_effect/agent_pinpointer/hunter_edition
minimum_range = HUNTER_SCAN_MIN_DISTANCE
tick_interval = HUNTER_SCAN_PING_TIME
duration = 10 SECONDS
range_fuzz_factor = 5 //PINPOINTER_EXTRA_RANDOM_RANGE
/atom/movable/screen/alert/status_effect/agent_pinpointer/hunter_edition
name = "Monster Tracking"
desc = "You always know where the hellspawn are."
/datum/status_effect/agent_pinpointer/hunter_edition/scan_for_target()
var/turf/my_loc = get_turf(owner)
var/list/mob/living/carbon/monsters = list()
for(var/datum/antagonist/monster in GLOB.antagonists)
var/datum/mind/brain = monster.owner
if(brain == owner || !brain)
continue
if(IS_HERETIC(brain.current) || IS_BLOODSUCKER(brain.current) || iscultist(brain.current) || is_servant_of_ratvar(brain.current) || IS_WIZARD(brain.current))
monsters += brain
if(brain.has_antag_datum(/datum/antagonist/changeling))
monsters += brain
if(brain.has_antag_datum(/datum/antagonist/ashwalker))
monsters += brain
if(monsters.len)
/// Point at a 'random' monster, biasing heavily towards closer ones.
scan_target = pickweight(monsters)
to_chat(owner, span_warning("You detect signs of monsters to the <b>[dir2text(get_dir(my_loc,get_turf(scan_target)))]!</b>"))
else
scan_target = null
/datum/status_effect/agent_pinpointer/hunter_edition/Destroy()
if(scan_target)
to_chat(owner, span_notice("You've lost the trail."))
. = ..()
/datum/outfit/monsterhunter
name = "Monster Hunter"
head = /obj/item/clothing/head/helmet/chaplain/witchunter_hat
uniform = /obj/item/clothing/under/rank/civilian/chaplain
suit = /obj/item/clothing/suit/armor/riot/chaplain/witchhunter
l_hand = /obj/item/stake
r_hand = /obj/item/stake/hardened/silver