· 4 years ago · Aug 26, 2021, 03:38 PM
1package com.shattered.script.api
2
3import com.shattered.game.actor.character.player.Player
4import com.shattered.game.grid.GridCoordinate
5import com.shattered.script.api.impl.*
6
7abstract class RelicPlayerAPI(player: Player) : RelicCharacterAPI(player) {
8
9 /**
10 * Represents the Character referenced for API
11 */
12 val player: Player = player
13
14 /**
15 * Represents the Channel API
16 * This API is used for social related functions and utilities.
17 */
18 val channel: PlayerChannelAPI = PlayerChannelAPI(player)
19
20 /**
21 * Represents the Quest API
22 * This API is used for any questing related functions and utilities.
23 */
24 val quest: PlayerQuestAPI = PlayerQuestAPI(player)
25
26 /**
27 * Represents the Container API
28 * This API is used for any containers related functions and utilities.
29 * i.e Inventory, Banks, Equipment, etc.
30 */
31 val containers: PlayerContainerAPI = PlayerContainerAPI(player)
32
33 /**
34 * Represents the Trades API
35 * This API is used for any relative functions and utilities for Tradesmen
36 */
37 val trades: PlayerTradesAPI = PlayerTradesAPI(player)
38
39 /**
40 * Used for sending the Required Notification
41 * i.e the Box over the reticle with a red warning symbol, and red text. Symbolizing a 'Required' for action.
42 */
43 abstract fun notify_required(message: String?)
44
45 /**
46 * Used for displaying the Action Timer with Cancel Option
47 */
48 abstract fun display_cancel_timer(action: String?, duration: Int);
49
50 /**
51 * Begins the action of the specified {@link ActionScript}
52 */
53 abstract fun start_action(action: String)
54
55 /**
56 * Begins the action of the specified {@link ActionScript} with parameters
57 */
58 abstract fun start_action(actionName: String?, vararg parameters: Any?)
59
60 /**
61 * Stops the current action for the player
62 */
63 abstract fun stop_action()
64
65 /**
66 * Method used for increasing a player stat,
67 * this method also triggers the notification
68 *
69 * To increase a stat without a notification, {@see CharacterVarAPI#var_increment}
70 */
71 abstract fun stat_increase(stat: String?, amount: Int)
72
73 /**
74 * Method used for increasing a trade skill stat,
75 * this method also triggers the notification
76 *
77 * To increase a trade skill stat without a notification, {@see CharacterVarAPI#var_increment}
78 */
79 abstract fun trade_increase(trade: String?, amount: Int)
80
81 /**
82 * Method used for displaying a warning message on top of the screen.
83 */
84 abstract fun top_warning_message(message: String?)
85
86 /**
87 * Method used for displaying a warning message above the player's head.
88 */
89 abstract fun overhead_warning_message(message: String?)
90
91 /**
92 * Method used for displaying a warning message above an actors position
93 */
94 abstract fun overhead_warning_message(actor: RelicActorAPI?, message: String?)
95
96 /**
97 * Makes the Player play an Animation with the provided Id.
98 * @param animationId
99 */
100 abstract fun play_animation(animationId: Int)
101
102 /**
103 * Makes the Player stop playing their current animation
104 */
105 abstract fun stop_animation()
106
107 /**
108 * Makes the Player play an Animation with the provided Animation Name
109 * @param animationName
110 */
111 abstract fun play_animation(animationName: String?)
112
113 /**
114 * Sends a projectile from the the specified characater socket
115 */
116 abstract fun send_projectile(name: String?, socket: String?)
117
118 /**
119 * Sends a projectile from the specified socket, at the desired speed
120 */
121 abstract fun send_projectile(name: String?, speed: Int = 1000, socket: String?)
122
123 /**
124 * Makes the player play a Sound Track with the provided Track Name.
125 * @param trackName
126 */
127 abstract fun play_track(trackName: String)
128
129 /**
130 * Makes the player play a sfx at the player's location
131 */
132 abstract fun play_sfx(sfxName: String, loc: GridCoordinate)
133
134 /**
135 * Creates the Widget with the given referenced name.
136 * @param widget
137 */
138 abstract fun create_widget(widget: String?)
139
140 /**
141 * Destructs the widget with the given referenced name.
142 * @param widget
143 */
144 abstract fun destruct_widget(widget: String?)
145
146 /**
147 * Shows the Widget with the given referenced name.
148 * @param widget
149 */
150 abstract fun show_widget(widget: String?)
151
152 /**
153 * Hides the widget with the given referenced name.
154 * @param widget
155 */
156 abstract fun hide_widget(widget: String?)
157
158 /**
159 * Sets the widget param with the specified key and value
160 */
161 abstract fun set_widget_param(widget: String?, key: String?, value: String?)
162
163 /**
164 * Sets the widget param with the specified key and value
165 */
166 abstract fun set_widget_param(widget: String?, key: String?, value: Int)
167
168 /**
169 * Sets the widget param with the specified key and value
170 */
171 abstract fun set_widget_param(widget: String?, key: String?, value: Boolean)
172
173 /**
174 * Adds an amount of experience to a specific stat
175 */
176 abstract fun add_stat_xp(stat: String?, amount: Int)
177
178 /**
179 * Gets the amount of xp for a specific stat
180 */
181 abstract fun get_stat_xp(stat: String?) : Int
182
183 /**
184 * Adds reputation for a specific key
185 */
186 abstract fun add_reputation(key: String?, amount: Int)
187
188 /**
189 * Returns the amount of reputation for a specific key
190 */
191 abstract fun get_reputation(key: String?) : Int
192
193 /**
194 * Checks if the player is in a party
195 */
196 abstract fun in_party() : Boolean
197
198 /**
199 * Checks if the player is in a party
200 */
201 abstract fun in_party(player: RelicPlayerAPI?) : Boolean
202
203 /**
204 * Gets a list of all of the party members
205 */
206 abstract fun get_party_members() : MutableMap<Int, RelicPlayerAPI?>
207
208 /**
209 * Adds the ability to your ability book with notification
210 */
211 abstract fun learn_ability(abilityName: String?)
212
213 /**
214 * Adds the ability to your ability book and toggles notification
215 */
216 abstract fun learn_ability(abilityName: String?, notify: Boolean)
217
218 /**
219 * Adds the recipe to your recipe book with notification
220 */
221 abstract fun learn_recipe(recipeName: String?)
222
223 /**
224 * Adds the recipe to your ability book and toggles notification
225 */
226 abstract fun learn_recipe(recipeName: String?, notify: Boolean)
227
228}