Add taunt passive

develop
Nathan Steel 1 year ago
parent 3e512459cf
commit a70f052780

@ -0,0 +1,2 @@
INSERT INTO `passive` (`id`, `passiveName`, `passiveDescription`) VALUES (3, 'Taunt', 'Must be targetted by attacks');

@ -368,6 +368,10 @@ class Board{
this.printCenterText('R', positionX + (10*passiveCount), positionY);
passiveCount++;
}
if(itemKey in taunt){
this.printCenterText('T', positionX + (10*passiveCount), positionY);
passiveCount++;
}
}
printColourRequirements(itemKey){
// Set the size(s)

@ -60,10 +60,25 @@ function debugEffectFunction(damageAmount = null, targetId = null, targetId2 = n
console.log(targetId+' Reach: '+reach[targetId]);
}
if(effect == 'taunt'){
console.log(targetId+' Taunt: '+taunt[targetId]);
console.log(effectAddRemove);
if(effectAddRemove == 'remove'){
removeTaunt(targetId);
}else{
giveTaunt(targetId);
}
console.log(targetId+' Taunt: '+reach[targetId]);
}
if(effect == 'draw'){
drawCard(damageAmount, targetPlayer);
}
if(effect == 'equip'){}
board.drawBoard();
}
@ -89,6 +104,8 @@ function debugTriggerFunction(targetId = null, trigger = null, triggerAmount = n
if(trigger == 'pay'){
triggerPay(triggerAmount);
}
board.drawBoard();
}
// Builds console log for card effect (inc.
@ -165,9 +182,9 @@ function debugEffectCanTrigger(){
if(doEffectTriggers(ecTriggerTargetId, ecTriggerIndex, true) != true){
console.log('Effect cannot be triggered');
queueEffect(ecTriggerTargetId, ecTriggerIndex);
//queueEffect(ecTriggerTargetId, ecTriggerIndex);
//doNextInQueue();
loopTriggerQueue();
//loopTriggerQueue();
return false;
}
@ -179,7 +196,12 @@ function debugEffectCanTrigger(){
// Then queue the effects to happen (queued so they can be chained/countered)
queueEffect(ecTriggerTargetId, ecTriggerIndex);
// Do all effects in queue (for debug), in actual will do one, then allow chain triggers, etc.
loopTriggerQueue();
}
board.drawBoard();
}

@ -8,6 +8,7 @@ let triggerQueueTargets = []; // Whatever was targetted by the effect, etc. in t
// Passive effects (just does stuff)
let flight = {};
let reach = {};
let taunt = {};
let equipped = {}; // Entity x has [a,b,c] equipped to it
@ -30,6 +31,7 @@ const basicEffects = {
3: 'Hurt',
4: 'Recruit',
5: 'Give Flight',
6: 'Taunt',
};
@ -55,6 +57,17 @@ function removeReach(card){
}
return false;
}
function giveTaunt(card){
taunt[card] = true;
}
function removeTaunt(card){
// If the card has flight delete entity component
if(card in taunt){
delete taunt[card];
return true;
}
return false;
}
// Active
function equip(){
@ -554,6 +567,11 @@ function doEffect(itemKey, effectIndex, effectStep, effectTriggerId){
givePassive(itemKey, effectIndex, effectStep, step['amount'], effectTriggerId, 'flight');
break;
// Give Taunt
case 6:
givePassive(itemKey, effectIndex, effectStep, step['amount'], effectTriggerId, 'taunt');
break;
}
// Add the selected targets to the queuedItem so it can be referred to in future

@ -80,6 +80,7 @@
<option value="">-- Add/Remove --</option>
<option value="flight">Flight</option>
<option value="reach">Reach</option>
<option value="taunt">Taunt</option>
<option value="equipCard">Equip</option>
<option value="unequipCard">unEquip</option>

Loading…
Cancel
Save