-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy path_martial_arts.dm
27 lines (24 loc) · 1.09 KB
/
_martial_arts.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
/obj/item/book/granter/martial
/// The martial arts type we give
var/datum/martial_art/martial
/// The name of the martial arts, formatted in a more text-friendly way.
var/martial_name = ""
/// The text given to the user when they learn the martial arts
var/greet = ""
/obj/item/book/granter/martial/can_learn(mob/user)
if(!martial)
CRASH("Someone attempted to learn [type], which did not have a martial arts set.")
if(user.mind.has_martialart(initial(martial.id)))
to_chat(user, span_warning("You already know [martial_name]!"))
return FALSE
if(SSticker.current_state == GAME_STATE_FINISHED)//instant after the round ends
on_reading_finished(user)
return FALSE
return TRUE
/obj/item/book/granter/martial/on_reading_start(mob/user)
to_chat(user, span_notice("You start reading about [martial_name]..."))
/obj/item/book/granter/martial/on_reading_finished(mob/user)
to_chat(user, "[greet]")
var/datum/martial_art/martial_to_learn = new martial()
martial_to_learn.teach(user)
user.log_message("learned the martial art [martial_name] ([martial_to_learn])", LOG_ATTACK, color = "orange")