cache[fightBlockKey]
);
+ if(fightData.roundData.winner !== 'in-progress') {
+ delete cache[fightBlockKey];
+ }
+
if(fightData.monsters.length && monster.fight_trigger === 'explore') {
html += renderMonsterSelector(fightData.monsters, monster.ref_id);
}
return html.join("\n");
}
+function CastButton(blockTime?: number): string {
+ const attrs = {
+ id: 'cast-button',
+ type: 'submit',
+ class: ['fight-action', 'red'],
+ name: 'action',
+ value: 'cast'
+ };
+
+ if(blockTime) {
+ return ButtonWithBlock(attrs, 'Cast', blockTime);
+ }
+ else {
+ return Button(attrs, 'Cast');
+ }
+
+}
+
function AttackButton(blockTime?: number): string {
const attrs = {
id: 'attack-button',
<option value="legs">Legs</option>
</select>
${AttackButton(blockTime)}
- <button type="submit" class="fight-action red" name="action" value="cast">Cast</button>
+ ${CastButton(blockTime)}
<button type="submit" class="fight-action" name="action" value="flee">Flee</button>
</form>
`: ''}
<option value="legs">Legs</option>
</select>
${AttackButton()}
- <button type="submit" class="fight-action red" name="action" value="cast">Cast</button>
+ ${CastButton()}
<button type="submit" class="fight-action" name="action" value="flee">Flee</button>
</form>
`: ''}