Files

48 lines
20 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../../../"><link rel="stylesheet" href="dmdoc.css"><title>/obj/item/toy/mecha - /tg/ Station 13</title></head><body><header><a href="index.html">/tg/ Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a><a href="obj/item/toy/mecha.html#var">Var Details</a> - <a href="obj/item/toy/mecha.html#proc">Proc Details</a></header><main><h1>mecha <aside>/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/<a href="obj/item/toy/mecha.html">toy/mecha</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L14"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 14"></a></h1><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="obj/item/toy/mecha.html#var/combat_health">combat_health</a></th><td>The mech's health in battle</td></tr><tr><th><a href="obj/item/toy/mecha.html#var/cooldown">cooldown</a></th><td>Cooldown between play sessions</td></tr><tr><th><a href="obj/item/toy/mecha.html#var/cooldown_multiplier">cooldown_multiplier</a></th><td>Cooldown multiplier after a battle (by default: battle cooldowns are 30 seconds)</td></tr><tr><th><a href="obj/item/toy/mecha.html#var/in_combat">in_combat</a></th><td>TRUE = in combat currently || FALSE = Not in combat</td></tr><tr><th><a href="obj/item/toy/mecha.html#var/losses">losses</a></th><td>...And their loss count in combat</td></tr><tr><th><a href="obj/item/toy/mecha.html#var/max_combat_health">max_combat_health</a></th><td>The mech's max combat health</td></tr><tr><th><a href="obj/item/toy/mecha.html#var/quiet">quiet</a></th><td>If it makes noise when played with</td></tr><tr><th><a href="obj/item/toy/mecha.html#var/special_attack_charged">special_attack_charged</a></th><td>TRUE = the special attack is charged || FALSE = not charged</td></tr><tr><th><a href="obj/item/toy/mecha.html#var/special_attack_cooldown">special_attack_cooldown</a></th><td>Current cooldown of their special attack</td></tr><tr><th><a href="obj/item/toy/mecha.html#var/special_attack_cry">special_attack_cry</a></th><td>The battlecry when using the special attack</td></tr><tr><th><a href="obj/item/toy/mecha.html#var/special_attack_type">special_attack_type</a></th><td>What type of special attack they use - SPECIAL_ATTACK_DAMAGE, SPECIAL_ATTACK_HEAL, SPECIAL_ATTACK_UTILITY, SPECIAL_ATTACK_OTHER</td></tr><tr><th><a href="obj/item/toy/mecha.html#var/special_attack_type_message">special_attack_type_message</a></th><td>What message their special move gets on examining</td></tr><tr><th><a href="obj/item/toy/mecha.html#var/timer">timer</a></th><td>Timer when it'll be off cooldown</td></tr><tr><th><a href="obj/item/toy/mecha.html#var/wants_to_battle">wants_to_battle</a></th><td>TRUE = Offering battle to someone || FALSE = Not offering battle</td></tr><tr><th><a href="obj/item/toy/mecha.html#var/wins">wins</a></th><td>This mech's win count in combat</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="obj/item/toy/mecha.html#proc/attack">attack</a></th><td>Attack is called from the user's toy, aimed at target(another human), checking for target's toy.</td></tr><tr><th><a href="obj/item/toy/mecha.html#proc/attack_tk">attack_tk</a></th><td>Overrides attack_tk - Sorry, you have to be face to face to initiate a battle, it's good sportsmanship</td></tr><tr><th><a href="obj/item/toy/mecha.html#proc/attackby">attackby</a></th><td>If you attack a mech with a mech, initiate combat between them</td></tr><tr><th><a href="obj/item/toy/mecha.html#proc/check_battle_start">check_battle_start</a></th><td>This proc checks if a battle can be initiated between src and attacker.</td></tr><tr><th><a href="obj/item/toy/mecha.html#proc/combat_sleep">combat_sleep</a></th><td>this proc combines &quot;sleep&quot; while also checking for if the battle should continue</td></tr><tr><th><a href="obj/item/toy/mecha.html#proc/mecha_brawl">mecha_brawl</a></th><td>The 'master' proc of the mech battle. Processes the entire battle's events and makes sure it start and finishes correctly.</td></tr><tr><th><a href="obj/item/toy/mecha.html#proc/special_attack_move">special_attack_move</a></th><td>Processes any special attack moves that happen in the battle (called in the mechaBattle proc).</td></tr><tr><th><a href="obj/item/toy/mecha.html#proc/suicide_act">suicide_act</a></th><td>Starts a battle, toy mech vs player. Player... doesn't win.</td></tr><tr><th><a href="obj/item/toy/mecha.html#proc/super_special_attack">super_special_attack</a></th><td>Base proc for 'other' special attack moves.</td></tr><tr><th><a href="obj/item/toy/mecha.html#proc/withdraw_offer">withdraw_offer</a></th><td>Resets the request for battle.</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/combat_health"><aside class="declaration">var </aside>combat_health <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L35"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 35"></a></h3><p>The mech's health in battle</p><h3 id="var/cooldown"><aside class="declaration">var </aside>cooldown <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L25"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 25"></a></h3><p>Cooldown between play sessions</p><h3 id="var/cooldown_multiplier"><aside class="declaration">var </aside>cooldown_multiplier <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L27"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 27"></a></h3><p>Cooldown multiplier after a battle (by default: battle cooldowns are 30 seconds)</p><h3 id="var/in_combat"><aside class="declaration">var </aside>in_combat <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L33"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 33"></a></h3><p>TRUE = in combat currently || FALSE = Not in combat</p><h3 id="var/losses"><aside class="declaration">var </aside>losses <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L51"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 51"></a></h3><p>...And their loss count in combat</p><h3 id="var/max_combat_health"><aside class="declaration">var </aside>max_combat_health <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L37"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 37"></a></h3><p>The mech's max combat health</p><h3 id="var/quiet"><aside class="declaration">var </aside>quiet <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L29"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 29"></a></h3><p>If it makes noise when played with</p><h3 id="var/special_attack_charged"><aside class="declaration">var </aside>special_attack_charged <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L39"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 39"></a></h3><p>TRUE = the special attack is charged || FALSE = not charged</p><h3 id="var/special_attack_cooldown"><aside class="declaration">var </aside>special_attack_cooldown <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L47"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 47"></a></h3><p>Current cooldown of their special attack</p><h3 id="var/special_attack_cry"><aside class="declaration">var </aside>special_attack_cry <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L45"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 45"></a></h3><p>The battlecry when using the special attack</p><h3 id="var/special_attack_type"><aside class="declaration">var </aside>special_attack_type <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L41"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 41"></a></h3><p>What type of special attack they use - SPECIAL_ATTACK_DAMAGE, SPECIAL_ATTACK_HEAL, SPECIAL_ATTACK_UTILITY, SPECIAL_ATTACK_OTHER</p><h3 id="var/special_attack_type_message"><aside class="declaration">var </aside>special_attack_type_message <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L43"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 43"></a></h3><p>What message their special move gets on examining</p><h3 id="var/timer"><aside class="declaration">var </aside>timer <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L23"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 23"></a></h3><p>Timer when it'll be off cooldown</p><h3 id="var/wants_to_battle"><aside class="declaration">var </aside>wants_to_battle <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L31"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 31"></a></h3><p>TRUE = Offering battle to someone || FALSE = Not offering battle</p><h3 id="var/wins"><aside class="declaration">var </aside>wins <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L49"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 49"></a></h3><p>This mech's win count in combat</p><h2 id="proc">Proc Details</h2><h3 id="proc/attack"><aside class="parent"><a title="/obj/item" href="obj/item.html#proc/attack"></a></aside>attack<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/carbon.html">carbon</a>/<a href="mob/living/carbon/human.html">human</a>/target, /<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/carbon.html">carbon</a>/<a href="mob/living/carbon/human.html">human</a>/user) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L156"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 156"></a></aside></h3><p>Attack is called from the user's toy, aimed at target(another human), checking for target's toy.</p><h3 id="proc/attack_tk">attack_tk<aside>(/<a href="mob.html">mob</a>/user) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L191"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 191"></a></aside></h3><p>Overrides attack_tk - Sorry, you have to be face to face to initiate a battle, it's good sportsmanship</p><h3 id="proc/attackby">attackby<aside>(/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/user_toy, /<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/user) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L146"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 146"></a></aside></h3><p>If you attack a mech with a mech, initiate combat between them</p><h3 id="proc/check_battle_start"><aside class="declaration">proc </aside>check_battle_start<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/carbon.html">carbon</a>/user, /<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/<a href="obj/item/toy/mecha.html">toy/mecha</a>/attacker, /<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/carbon.html">carbon</a>/target) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L443"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 443"></a></aside></h3><p>This proc checks if a battle can be initiated between src and attacker.</p>
<p>Both SRC and attacker (if attacker is included) timers are checked if they're on cooldown, and
both SRC and attacker (if attacker is included) are checked if they are in combat already.
If any of the above are true, the proc returns FALSE and sends a message to user (and target, if included) otherwise, it returns TRUE
Arguments:</p>
<ul>
<li>user: the user who is initiating the battle</li>
<li>attacker: optional arg for checking two mechs at once</li>
<li>target: optional arg used in Mech PvP battles (if used, attacker is target's toy)</li>
</ul><h3 id="proc/combat_sleep"><aside class="declaration">proc </aside>combat_sleep<aside>(delay, /<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/<a href="obj/item/toy/mecha.html">toy/mecha</a>/attacker, /<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/carbon.html">carbon</a>/attacker_controller, /<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/carbon.html">carbon</a>/opponent) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L84"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 84"></a></aside></h3><p>this proc combines &quot;sleep&quot; while also checking for if the battle should continue</p>
<p>this goes through some of the checks - the toys need to be next to each other to fight!
if it's player vs themself: They need to be able to &quot;control&quot; both mechs (either must be adjacent or using TK)
if it's player vs player: Both players need to be able to &quot;control&quot; their mechs (either must be adjacent or using TK)
if it's player vs mech (suicide): the mech needs to be in range of the player
if all the checks are TRUE, it does the sleeps, and returns TRUE. Otherwise, it returns FALSE.
Arguments:</p>
<ul>
<li>delay - the amount of time the sleep at the end of the check will sleep for</li>
<li>attacker - the attacking toy in the battle.</li>
<li>attacker_controller - the controller of the attacking toy. there should ALWAYS be an attacker_controller</li>
<li>opponent - (optional) the defender controller in the battle, for PvP</li>
</ul><h3 id="proc/mecha_brawl"><aside class="declaration">proc </aside>mecha_brawl<aside>(/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/<a href="obj/item/toy/mecha.html">toy/mecha</a>/attacker, /<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/carbon.html">carbon</a>/attacker_controller, /<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/carbon.html">carbon</a>/opponent) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L283"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 283"></a></aside></h3><p>The 'master' proc of the mech battle. Processes the entire battle's events and makes sure it start and finishes correctly.</p>
<p>src is the defending toy, and the battle proc is called on it to begin the battle.
After going through a few checks at the beginning to ensure the battle can start properly, the battle begins a loop that lasts
until either toy has no more health. During this loop, it also ensures the mechs stay in combat range of each other.
It will then randomly decide attacks for each toy, occasionally making one or the other use their special attack.
When either mech has no more health, the loop ends, and it displays the victor and the loser while updating their stats and resetting them.
Arguments:</p>
<ul>
<li>attacker - the attacking toy, the toy in the attacker_controller's hands</li>
<li>attacker_controller - the user, the one who is holding the toys / controlling the fight</li>
<li>opponent - optional arg used in Mech PvP battles: the other person who is taking part in the fight (controls src)</li>
</ul><h3 id="proc/special_attack_move"><aside class="declaration">proc </aside>special_attack_move<aside>(/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/<a href="obj/item/toy/mecha.html">toy/mecha</a>/victim) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L470"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 470"></a></aside></h3><p>Processes any special attack moves that happen in the battle (called in the mechaBattle proc).</p>
<p>Makes the toy shout their special attack cry and updates its cooldown. Then, does the special attack.
Arguments:</p>
<ul>
<li>victim - the toy being hit by the special move</li>
</ul><h3 id="proc/suicide_act">suicide_act<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/carbon.html">carbon</a>/user) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L214"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 214"></a></aside></h3><p>Starts a battle, toy mech vs player. Player... doesn't win.</p><h3 id="proc/super_special_attack"><aside class="declaration">proc </aside>super_special_attack<aside>(/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/<a href="obj/item/toy/mecha.html">toy/mecha</a>/victim) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L499"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 499"></a></aside></h3><p>Base proc for 'other' special attack moves.</p>
<p>This one is only for inheritance, each mech with an 'other' type move has their procs below.
Arguments:</p>
<ul>
<li>victim - the toy being hit by the super special move (doesn't necessarily need to be used)</li>
</ul><h3 id="proc/withdraw_offer"><aside class="declaration">proc </aside>withdraw_offer<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/carbon.html">carbon</a>/user) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/toy_mechs.dm#L207"><img src="git.png" width="16" height="16" title="code/game/objects/items/toy_mechs.dm 207"></a></aside></h3><p>Resets the request for battle.</p>
<p>For use in a timer, this proc resets the wants_to_battle variable after a short period.
Arguments:</p>
<ul>
<li>user - the user wanting to do battle</li>
</ul></main><footer>tgstation.dme <a href="https://github.com/evilew/GS13-Citadel/tree/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e">e8e0068</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.9.0</a></footer></body></html>