Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta #2309

Merged
merged 12 commits into from
Nov 30, 2023
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ package-lock.json
/dist/
dist/
/database/mariadb/
/allArmors.txt
/allWeapons.txt
/allItems.txt
/allPotions.txt
/allObjects.txt
2 changes: 1 addition & 1 deletion resources/text/classes/12.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"breathRegen": 3,
"classGroup": 0,
"fightActionsIds": [
"simpleAttack",
"shieldAttack",
"quickAttack",
"resting"
]
Expand Down
2 changes: 1 addition & 1 deletion resources/text/classes/13.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"breathRegen": 3,
"classGroup": 1,
"fightActionsIds": [
"simpleAttack",
"shieldAttack",
"quickAttack",
"heavyAttack",
"resting"
Expand Down
2 changes: 1 addition & 1 deletion resources/text/classes/14.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"breathRegen": 3,
"classGroup": 2,
"fightActionsIds": [
"simpleAttack",
"shieldAttack",
"quickAttack",
"heavyAttack",
"benediction",
Expand Down
2 changes: 1 addition & 1 deletion resources/text/classes/15.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"breathRegen": 3,
"classGroup": 3,
"fightActionsIds": [
"simpleAttack",
"shieldAttack",
"quickAttack",
"heavyAttack",
"benediction",
Expand Down
2 changes: 1 addition & 1 deletion resources/text/classes/21.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"breathRegen": 3,
"classGroup": 4,
"fightActionsIds": [
"simpleAttack",
"shieldAttack",
"quickAttack",
"heavyAttack",
"benediction",
Expand Down
4 changes: 2 additions & 2 deletions resources/text/fightactions/canonAttack.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"fr": {
"name": "Attaque canon",
"namePlural": "Attaques canons",
"description": "La précision de cette attaque baisse sur les adversaires rapides. Un bonus de dégât est affecté à cette attaque si l’adversaire est très lent."
"description": "La précision de cette attaque baisse sur les adversaires rapides. Un bonus de dégât est affecté à cette attaque si l’adversaire est très lent. L'adversaire peut être ralenti par l'attaque. Inflige plus de dégâts si utilisé plusieurs fois de suite"
},
"en": {
"name": "Cannon attack",
"namePlural": "Cannon attacks",
"description": "The precision of this attack decreases on fast enemies. A bonus damage is added to this attack if the enemy is very slow."
"description": "The precision of this attack decreases on fast enemies. A bonus damage is added to this attack if the enemy is very slow. The enemy has a chance of being slowed down by the attack. Deals more damage if used multiple times in a row."
}
},
"emote": "\uD83D\uDD2B",
Expand Down
4 changes: 2 additions & 2 deletions resources/text/fightactions/concentrated.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"translations": {
"fr": {
"heal": "n'est plus concentré.",
"new": "concentre son pouvoir. `Attaque : + 100%` `Vitesse : + 100%`",
"new": "concentre son pouvoir. `Boost de dégâts actif`",
BastLast marked this conversation as resolved.
Show resolved Hide resolved
"active": "concentre son pouvoir."
},
"en": {
"heal": "is no longer concentrated.",
"new": "concentrates his power. `Attack: + 100%` `Speed: + 100%`",
"new": "concentrates his power. `Damage boost active`",
"active": "concentrates his power."
}
},
Expand Down
4 changes: 2 additions & 2 deletions resources/text/fightactions/concentration.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"namePlural": "Concentrations",
"active": "essaie de se concentrer...",
"fail": "ne parvient pas à se concentrer !",
"description": "Échoue si vous utilisez cette action alors que vous avez une altération d’état. L’altération \"concentré\" double la vitesse et l’attaque durant 1 tour."
"description": "Échoue si vous utilisez cette action alors que vous avez une altération d’état. L’altération \"concentré\" augmente fortement les dégâts infligés par le combattant affecté lors du prochain tour."
BastLast marked this conversation as resolved.
Show resolved Hide resolved
},
"en": {
"name": "Concentration",
"namePlural": "Concentrations",
"active": "is trying to concentrate...",
"fail": "can't concentrate!",
"description": "Fails if you use this action while you have an alteration. The alteration \"concentrated\" doubles the speed and attack duration for 1 turn."
"description": "Fails if you use this action while you have an alteration. The alteration \"concentrated\" increases highly the damages dealt by the affected fighter during the next turn."
BastLast marked this conversation as resolved.
Show resolved Hide resolved
}
},
"emote": "\uD83C\uDFAF",
Expand Down
4 changes: 2 additions & 2 deletions resources/text/fightactions/heavyAttack.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"fr": {
"name": "Attaque lourde",
"namePlural": "Attaques lourdes",
"description": "Les dégâts de cette attaque sont réduits de 90% si le défenseur dispose de moins de défense que l’attaquant."
"description": "Les dégâts de cette attaque sont réduits de 90% si le défenseur dispose de moins de défense que l’attaquant. La défense de l'ennemi est réduite de 25%."
},
"en": {
"name": "Heavy attack",
"namePlural": "Heavy attacks",
"description": "The damage of this attack is reduced by 90% if the defender has less defense than the attacker."
"description": "The damage of this attack is reduced by 90% if the defender has less defense than the attacker. The enemy's defense is reduced by 25%."
}
},
"emote": "\uD83D\uDD28",
Expand Down
4 changes: 2 additions & 2 deletions resources/text/fightactions/piercingAttack.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"fr": {
"name": "Attaque perçante",
"namePlural": "Attaques perçantes",
"description": "Ignore presque complètement la défense de l’adversaire."
"description": "Ignore presque complètement la défense de l’adversaire. L'attaquant a une probabilité de réduire légèrement la défense de son adversaire."
},
"en": {
"name": "Piercing attack",
"namePlural": "Piercing attacks",
"description": "Ignores almost all the opponent's defense."
"description": "Ignores almost all the opponent's defense. The attacker has a chance to slightly reduce the defense of his opponent."
}
},
"emote": "\uD83E\uDEA1",
Expand Down
4 changes: 2 additions & 2 deletions resources/text/fightactions/poisonousAttack.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"fr": {
"name": "Attaque empoisonnée",
"namePlural": "Attaques empoisonnées",
"description": "Empoisonne l'adversaire. L’altération \"empoisonné\" dure au moins un tour et inflige des dégâts à votre adversaire sur la durée."
"description": "Empoisonne l'adversaire. L’altération \"empoisonné\" dure au moins trois tours et inflige des dégâts à votre adversaire sur la durée."
},
"en": {
"name": "Poisonous attack",
"namePlural": "Poisonous attacks",
"description": "Poisons the enemy. The \"poisoned\" alteration lasts at least one turn and deals damage to your enemy on the duration."
"description": "Poisons the enemy. The \"poisoned\" alteration lasts at least three turns and deals damage to your enemy on the duration."
}
},
"emote": "\uD83E\uDDEA",
Expand Down
4 changes: 2 additions & 2 deletions resources/text/fightactions/powerfulAttack.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"fr": {
"name": "Attaque puissante",
"namePlural": "Attaques puissantes",
"description": "Cette attaque a 25 % de chance de faire +50% de dégâts, au prix d’un étourdissement de l’attaquant. Après 3 utilisations, les dégâts de l’attaque sont réduits de 70%."
"description": "Cette attaque a 25 % de chance de faire plus de dégâts, au prix d’un étourdissement de l’attaquant. Après 3 utilisations, les dégâts de l’attaque sont réduits de 70%."
},
"en": {
"name": "Powerful Attack",
"namePlural": "Powerful Attacks",
"description": "This attack has 25% chance to do +50% damage, at the cost of a stun. After 3 uses, the damage is reduced by 70%."
"description": "This attack has 25% chance to do more damage, at the cost of a stun. After 3 uses, the damage is reduced by 70%."
}
},
"emote": "\uD83E\uDE93",
Expand Down
4 changes: 2 additions & 2 deletions resources/text/fightactions/ramAttack.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"fr": {
"name": "Attaque bélier",
"namePlural": "Attaques béliers",
"description": "Si l’attaquant n’est pas étourdi par l’attaque, il reçoit 45% des dégâts infligés."
"description": "Si l’attaquant n’est pas étourdi par l’attaque, il reçoit une partie des dégâts infligés. L'attaque peut également étourdir l'adversaire."
},
"en": {
"name": "Ram Attack",
"namePlural": "Ram Attacks",
"description": "If the attacker is not dazed by the attack, he takes 45% of the damage."
"description": "If the attacker is not dazed by the attack, he takes part of the damage. The attack can also daze the opponent."
}
},
"emote": "\uD83D\uDC0F",
Expand Down
4 changes: 2 additions & 2 deletions resources/text/fightactions/sabotageAttack.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"fr": {
"name": "Attaque sabotage",
"namePlural": "Attaques sabotages",
"description": "Ignore complètement la défense de l’adversaire. Fonctionne mieux sur un adversaire ayant peu d’attaque."
"description": "Ignore complètement la défense de l’adversaire. Fonctionne mieux sur un adversaire ayant peu d’attaque. Attaque peu couteuse en souffle mais qui peut paralyser le lanceur. Si c’est le cas, les dégâts sont augmentés."
},
"en": {
"name": "Sabotage attack",
"namePlural": "Sabotage attacks",
"description": "Ignores the opponent’s defense completely. Works better on an opponent with low attack."
"description": "Ignores the opponent’s defense completely. Works better on an opponent with low attack. Attack that costs little breath but that can paralyzes the attacker. If that happens, the damages are increased."
BastLast marked this conversation as resolved.
Show resolved Hide resolved
}
},
"emote": "\uD83D\uDEE0️",
Expand Down
5 changes: 3 additions & 2 deletions src/core/fights/actions/interfaces/alterations/burned.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import {format} from "../../../../utils/StringFormatter";
import {FightActionController} from "../../FightActionController";
import {attackInfo, statsInfo} from "../../FightAction";
import {FightAlteration} from "../../FightAlteration";
import {RandomUtils} from "../../../../utils/RandomUtils";

export default class BurnedAlteration extends FightAlteration {
use(victim: Fighter, sender: Fighter, turn: number, language: string): string {
victim.alterationTurn++;
const burnedTranslationModule = Translations.getModule(`fightactions.${this.name}`, language);
// 60 % chance to be healed from the poison (except for the first two turns)
if (Math.random() < 0.6 && victim.alterationTurn > 1) {
// 60 % chance to be healed from the fire (except for the first turn)
if (RandomUtils.draftbotRandom.realZeroToOneInclusive() < 0.6 && victim.alterationTurn > 1) {
victim.removeAlteration();
return burnedTranslationModule.get("heal");
}
Expand Down
13 changes: 2 additions & 11 deletions src/core/fights/actions/interfaces/alterations/concentrated.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Fighter, FightStatModifierOperation} from "../../../fighter/Fighter";
import {Fighter} from "../../../fighter/Fighter";
import {Translations} from "../../../../Translations";
import {FightAlteration} from "../../FightAlteration";

Expand All @@ -13,16 +13,7 @@ export default class ConcentratedAlteration extends FightAlteration {
return concentratedTranslationModule.get("heal");
}
if (!victim.hasAttackModifier(this)) {
victim.applySpeedModifier({
origin: this,
operation: FightStatModifierOperation.MULTIPLIER,
value: 2
});
victim.applyAttackModifier({
origin: this,
operation: FightStatModifierOperation.MULTIPLIER,
value: 2
});
victim.applyDamageMultiplier(1.4,1);
return concentratedTranslationModule.get("new");
BastLast marked this conversation as resolved.
Show resolved Hide resolved
}
return concentratedTranslationModule.get("active");
Expand Down
3 changes: 2 additions & 1 deletion src/core/fights/actions/interfaces/alterations/confused.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import {Translations} from "../../../../Translations";
import {FightActionController} from "../../FightActionController";
import {attackInfo, FightAction, statsInfo} from "../../FightAction";
import {FightActions} from "../../FightActions";
import {RandomUtils} from "../../../../utils/RandomUtils";

export default class ConfusedAlteration extends FightAction {
use(sender: Fighter, receiver: Fighter, turn: number, language: string): string {
sender.alterationTurn++;
const randomValue = Math.random();
const randomValue = RandomUtils.draftbotRandom.realZeroToOneInclusive();
BastLast marked this conversation as resolved.
Show resolved Hide resolved

const confusionTranslationModule = Translations.getModule(`fightactions.${this.name}`, language);

Expand Down
3 changes: 2 additions & 1 deletion src/core/fights/actions/interfaces/alterations/cursed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import {attackInfo, statsInfo} from "../../FightAction";
import {FightAlteration} from "../../FightAlteration";
import {MathUtils} from "../../../../utils/MathUtils";
import {FightConstants} from "../../../../constants/FightConstants";
import {RandomUtils} from "../../../../utils/RandomUtils";

export default class PoisonedAlteration extends FightAlteration {
use(victim: Fighter, sender: Fighter, turn: number, language: string): string {
victim.alterationTurn++;
const curseTranslationModule = Translations.getModule(`fightactions.${this.name}`, language);
// 50 % chance to be healed from the cursed (except for the first two turn) and 100 % after 5 turns of being cursed
if (Math.random() < 0.25 && victim.alterationTurn > 2 || victim.alterationTurn > 4) {
if (RandomUtils.draftbotRandom.realZeroToOneInclusive() < 0.25 && victim.alterationTurn > 2 || victim.alterationTurn > 4) {
victim.removeAlteration();
let damageDealt = FightActionController.getAttackDamage(this.getStatsInfo(victim, sender), victim, this.getAttackInfo(), true);
damageDealt += MathUtils.getIntervalValue(0, damageDealt * 2, (victim.alterationTurn - 2) / 3);
Expand Down
3 changes: 2 additions & 1 deletion src/core/fights/actions/interfaces/alterations/frozen.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import {Fighter, FightStatModifierOperation} from "../../../fighter/Fighter";
import {FightAlteration} from "../../FightAlteration";
import {Translations} from "../../../../Translations";
import {RandomUtils} from "../../../../utils/RandomUtils";

export default class FrozenAlteration extends FightAlteration {
use(victim: Fighter, sender: Fighter, turn: number, language: string): string {
victim.alterationTurn++;
const frozenTranslationModule = Translations.getModule(`fightactions.${this.name}`, language);
// 50% chance to be healed from the frozen (except for the first two turns)
if (Math.random() < 0.5 && victim.alterationTurn > 2) {
if (RandomUtils.draftbotRandom.realZeroToOneInclusive() < 0.5 && victim.alterationTurn > 2) {
victim.removeSpeedModifiers(this);
victim.removeAlteration();
return frozenTranslationModule.get("heal");
Expand Down
3 changes: 2 additions & 1 deletion src/core/fights/actions/interfaces/alterations/paralyzed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {Fighter, FightStatModifierOperation} from "../../../fighter/Fighter";
import {Translations} from "../../../../Translations";
import {FightActions} from "../../FightActions";
import {FightAlteration} from "../../FightAlteration";
import {RandomUtils} from "../../../../utils/RandomUtils";

export default class ParalyzedAlteration extends FightAlteration {
use(victim: Fighter, sender: Fighter, turn: number, language: string): string {
Expand All @@ -14,7 +15,7 @@ export default class ParalyzedAlteration extends FightAlteration {
}

// 20% chance to not attack this turn
if (Math.random() < 0.2) {
if (RandomUtils.draftbotRandom.realZeroToOneInclusive() < 0.2) {
victim.nextFightAction = FightActions.getNoAttack();
return paralyzedTranslationModule.get("noAttack");
}
Expand Down
18 changes: 7 additions & 11 deletions src/core/fights/actions/interfaces/alterations/poisoned.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import {format} from "../../../../utils/StringFormatter";
import {FightActionController} from "../../FightActionController";
import {attackInfo, statsInfo} from "../../FightAction";
import {FightAlteration} from "../../FightAlteration";
import {RandomUtils} from "../../../../utils/RandomUtils";

export default class PoisonedAlteration extends FightAlteration {
use(victim: Fighter, sender: Fighter, turn: number, language: string): string {
victim.alterationTurn++;
const poisonTranslationModule = Translations.getModule(`fightactions.${this.name}`, language);
// 25 % chance to be healed from the poison (except for the first turn)
if (Math.random() < 0.25 && victim.alterationTurn > 1) {
// 35 % chance to be healed from the poison (except for the first 3 turn)
if (RandomUtils.draftbotRandom.realZeroToOneInclusive() < 0.35 && victim.alterationTurn > 3) {
victim.removeAlteration();
return poisonTranslationModule.get("heal");
}
Expand All @@ -23,20 +24,15 @@ export default class PoisonedAlteration extends FightAlteration {
return {minDamage: 10, averageDamage: 25, maxDamage: 45};
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
getStatsInfo(victim: Fighter, sender: Fighter): statsInfo {
return {
attackerStats: [
victim.getAttack(), // We use the defender's attack because the poison is applied to the attacker
sender.getAttack(),
victim.getFightPoints()
sender.getAttack()
], defenderStats: [
100,
100,
victim.getMaxFightPoints()
0
], statsEffect: [
0.5,
0.1,
0.4
1
]
};
}
Expand Down
3 changes: 2 additions & 1 deletion src/core/fights/actions/interfaces/alterations/stunned.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {Fighter} from "../../../fighter/Fighter";
import {Translations} from "../../../../Translations";
import {FightActions} from "../../FightActions";
import {FightAlteration} from "../../FightAlteration";
import {RandomUtils} from "../../../../utils/RandomUtils";

export default class StunnedAlteration extends FightAlteration {
use(victim: Fighter, sender: Fighter, turn: number, language: string): string {
Expand All @@ -13,7 +14,7 @@ export default class StunnedAlteration extends FightAlteration {
}

// 50% chance to not attack this turn
if (Math.random() < 0.5) {
if (RandomUtils.draftbotRandom.realZeroToOneInclusive() < 0.5) {
victim.nextFightAction = FightActions.getNoAttack();
return stunnedTranslationModule.get("noAttack");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {FightAlterations} from "../../FightAlterations";
import {FightConstants} from "../../../../constants/FightConstants";
import {Translations} from "../../../../Translations";
import {FightActionStatus} from "../../FightActionStatus";
import {RandomUtils} from "../../../../utils/RandomUtils";

export default class BoulderTossAttack extends FightAction {
use(sender: Fighter, receiver: Fighter, turn: number, language: string): string {
Expand All @@ -16,7 +17,7 @@ export default class BoulderTossAttack extends FightAction {
let sideEffects = "";

// 50% chance to stun the defender
if (this.getAttackStatus(damageDealt, initialDamage) !== FightActionStatus.MISSED && Math.random() < 0.5) {
if (this.getAttackStatus(damageDealt, initialDamage) !== FightActionStatus.MISSED && RandomUtils.draftbotRandom.realZeroToOneInclusive() < 0.5) {
const alteration = receiver.newAlteration(FightAlterations.STUNNED);
if (alteration === FightAlterations.STUNNED) {
sideEffects = attackTranslationModule.format("actions.sideEffects.newAlteration", {
Expand Down
2 changes: 1 addition & 1 deletion src/core/fights/actions/interfaces/players/benediction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class Benediction extends FightAction {

receiver.damage(damageDealt);
let sideEffects = "";
const buff = turn < 15 ? Math.round(1.67 * turn) : 25;
const buff = turn < 15 ? Math.round(2.27 * turn) : 45;

sender.applyDefenseModifier({
origin: this,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export default class BreathTakingAttack extends FightAction {
// 60% chance of reducing the opponent's speed by 20%. Otherwise, steal 1 point of breath from the opponent.
let sideEffects;
if (RandomUtils.draftbotRandom.bool(0.4) || receiver.getBreath() < 1) {
// Reduce target speed by 20%
const reduceAmount = 20;
// Reduce target speed by 15%
const reduceAmount = 15;
receiver.applySpeedModifier({
origin: this,
operation: FightStatModifierOperation.MULTIPLIER,
Expand Down
Loading
Loading