Fix for ranged monsters attack
This commit is contained in:
+6
-2
@@ -265,6 +265,10 @@ Hooks.on(hookName, (message, html, data) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Préparer le message de demande de défense
|
// Préparer le message de demande de défense
|
||||||
|
// Récupérer l'acteur attaquant pour vérifier le mode d'attaque
|
||||||
|
const attacker = game.actors.get(attackerId)
|
||||||
|
const isRangedAttack = attacker?.type === "monster" && attacker.system.attackMode === "ranged"
|
||||||
|
|
||||||
const defenseMsg = {
|
const defenseMsg = {
|
||||||
type: "requestDefense",
|
type: "requestDefense",
|
||||||
attackerName: attackerName,
|
attackerName: attackerName,
|
||||||
@@ -279,7 +283,8 @@ Hooks.on(hookName, (message, html, data) => {
|
|||||||
attackD30message: attackD30message,
|
attackD30message: attackD30message,
|
||||||
attackRerollContext: attackRerollContext,
|
attackRerollContext: attackRerollContext,
|
||||||
combatantId: combatantId,
|
combatantId: combatantId,
|
||||||
tokenId: tokenId
|
tokenId: tokenId,
|
||||||
|
isRanged: isRangedAttack
|
||||||
}
|
}
|
||||||
|
|
||||||
// Envoyer le message socket à l'utilisateur contrôlant le combatant
|
// Envoyer le message socket à l'utilisateur contrôlant le combatant
|
||||||
@@ -292,7 +297,6 @@ Hooks.on(hookName, (message, html, data) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Récupérer l'acteur attaquant pour vérifier qui l'a lancé
|
// Récupérer l'acteur attaquant pour vérifier qui l'a lancé
|
||||||
const attacker = game.actors.get(attackerId)
|
|
||||||
const attackerOwners = attacker ? game.users.filter(u => attacker.testUserPermission(u, "OWNER")).map(u => u.id) : []
|
const attackerOwners = attacker ? game.users.filter(u => attacker.testUserPermission(u, "OWNER")).map(u => u.id) : []
|
||||||
|
|
||||||
// Monsters always need their owner (usually the GM) to roll a save/defense,
|
// Monsters always need their owner (usually the GM) to roll a save/defense,
|
||||||
|
|||||||
@@ -4,70 +4,171 @@
|
|||||||
"melee_attack": {
|
"melee_attack": {
|
||||||
"type": "choice",
|
"type": "choice",
|
||||||
"choices": [
|
"choices": [
|
||||||
{ "type": "special_strike", "options": ["lethal", "vital"] },
|
{
|
||||||
{ "type": "bonus_dice", "dice": "D20E", "target": "attack" }
|
"type": "special_strike",
|
||||||
|
"options": [
|
||||||
|
"lethal",
|
||||||
|
"vital"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D20E",
|
||||||
|
"target": "attack"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"description": "Possible Lethal or Vital Strike or Add D20E to Attack"
|
"description": "Possible Lethal or Vital Strike or Add D20E to Attack"
|
||||||
},
|
},
|
||||||
"ranged_attack": {
|
"ranged_attack": {
|
||||||
"type": "choice",
|
"type": "choice",
|
||||||
"choices": [
|
"choices": [
|
||||||
{ "type": "special_strike", "options": ["lethal", "vital"] },
|
{
|
||||||
{ "type": "bonus_dice", "dice": "D20E", "target": "attack" }
|
"type": "special_strike",
|
||||||
|
"options": [
|
||||||
|
"lethal",
|
||||||
|
"vital"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D20E",
|
||||||
|
"target": "attack"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"description": "Possible Lethal or Vital Strike or Add D20E to Attack"
|
"description": "Possible Lethal or Vital Strike or Add D20E to Attack"
|
||||||
},
|
},
|
||||||
"melee_defense": {
|
"melee_defense": {
|
||||||
"type": "choice",
|
"type": "choice",
|
||||||
"choices": [
|
"choices": [
|
||||||
{ "type": "special_defense", "options": ["flawless", "legendary"] },
|
{
|
||||||
{ "type": "bonus_dice", "dice": "D20E", "target": "defense" }
|
"type": "special_defense",
|
||||||
|
"options": [
|
||||||
|
"flawless",
|
||||||
|
"legendary"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D20E",
|
||||||
|
"target": "defense"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"description": "Possible Flawless or Legendary Defense or Add D20E to Defense"
|
"description": "Possible Flawless or Legendary Defense or Add D20E to Defense"
|
||||||
},
|
},
|
||||||
"arcane_spell_attack": {
|
"arcane_spell_attack": {
|
||||||
"type": "choice",
|
"type": "choice",
|
||||||
"choices": [
|
"choices": [
|
||||||
{ "type": "special_strike", "options": ["lethal_magical", "vital_magical"] },
|
{
|
||||||
{ "type": "bonus_dice", "dice": "D20E", "target": "spell_attack" }
|
"type": "special_strike",
|
||||||
|
"options": [
|
||||||
|
"lethal_magical",
|
||||||
|
"vital_magical"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D20E",
|
||||||
|
"target": "spell_attack"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"description": "Possible Lethal or Vital Magical Strike or Add D20E to Spell Attack"
|
"description": "Possible Lethal or Vital Magical Strike or Add D20E to Spell Attack"
|
||||||
},
|
},
|
||||||
"arcane_spell_defense": {
|
"arcane_spell_defense": {
|
||||||
"type": "choice",
|
"type": "choice",
|
||||||
"choices": [
|
"choices": [
|
||||||
{ "type": "spell_calamity" },
|
{
|
||||||
{ "type": "bonus_dice", "dice": "D20E", "target": "spell_defense" }
|
"type": "spell_calamity"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D20E",
|
||||||
|
"target": "spell_defense"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"description": "Possible Spell Catastrophe or adds D20E to Spell Defense"
|
"description": "Possible Spell Catastrophe or adds D20E to Spell Defense"
|
||||||
},
|
},
|
||||||
"skill_rolls": {
|
"skill_rolls": {
|
||||||
"type": "skill_auto_success",
|
"type": "skill_auto_success",
|
||||||
"description": "Skill Succeeds Regardless of Opposing Roll"
|
"description": "Skill Succeeds Regardless of Opposing Roll"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "choice",
|
||||||
|
"choices": [
|
||||||
|
{
|
||||||
|
"type": "special_defense",
|
||||||
|
"options": [
|
||||||
|
"flawless",
|
||||||
|
"legendary"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D20E",
|
||||||
|
"target": "defense"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Possible Flawless or Legendary Defense or Add D20E to Defense"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"29": {
|
"29": {
|
||||||
"melee_attack": { "type": "gain_grit", "amount": 1, "description": "Gain 1 Grit" },
|
"melee_attack": {
|
||||||
"ranged_attack": { "type": "gain_grit", "amount": 1, "description": "Gain 1 Grit" },
|
"type": "gain_grit",
|
||||||
"melee_defense": { "type": "gain_grit", "amount": 1, "description": "Gain 1 Grit" },
|
"amount": 1,
|
||||||
"arcane_spell_attack": { "type": "gain_grit", "amount": 1, "description": "Gain 1 Grit" },
|
"description": "Gain 1 Grit"
|
||||||
"arcane_spell_defense": { "type": "gain_grit", "amount": 1, "description": "Gain 1 Grit" },
|
},
|
||||||
"skill_rolls": { "type": "gain_grit", "amount": 1, "description": "Gain 1 Grit" }
|
"ranged_attack": {
|
||||||
|
"type": "gain_grit",
|
||||||
|
"amount": 1,
|
||||||
|
"description": "Gain 1 Grit"
|
||||||
|
},
|
||||||
|
"melee_defense": {
|
||||||
|
"type": "gain_grit",
|
||||||
|
"amount": 1,
|
||||||
|
"description": "Gain 1 Grit"
|
||||||
|
},
|
||||||
|
"arcane_spell_attack": {
|
||||||
|
"type": "gain_grit",
|
||||||
|
"amount": 1,
|
||||||
|
"description": "Gain 1 Grit"
|
||||||
|
},
|
||||||
|
"arcane_spell_defense": {
|
||||||
|
"type": "gain_grit",
|
||||||
|
"amount": 1,
|
||||||
|
"description": "Gain 1 Grit"
|
||||||
|
},
|
||||||
|
"skill_rolls": {
|
||||||
|
"type": "gain_grit",
|
||||||
|
"amount": 1,
|
||||||
|
"description": "Gain 1 Grit"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "gain_grit",
|
||||||
|
"amount": 1,
|
||||||
|
"description": "Gain 1 Grit"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"28": {
|
"28": {
|
||||||
"melee_attack": { "type": "shield_destruction", "description": "Shield Destruction" }
|
"melee_attack": {
|
||||||
|
"type": "shield_destruction",
|
||||||
|
"description": "Shield Destruction"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"27": {
|
"27": {
|
||||||
"melee_attack": {
|
"melee_attack": {
|
||||||
"type": "bonus_dice", "dice": "D6", "target": "attack",
|
"type": "bonus_dice",
|
||||||
|
"dice": "D6",
|
||||||
|
"target": "attack",
|
||||||
"description": "Granted D6 (1-6) Attack Modifier for This Melee Attack"
|
"description": "Granted D6 (1-6) Attack Modifier for This Melee Attack"
|
||||||
},
|
},
|
||||||
"ranged_attack": {
|
"ranged_attack": {
|
||||||
"type": "bonus_dice", "dice": "D6", "target": "attack",
|
"type": "bonus_dice",
|
||||||
|
"dice": "D6",
|
||||||
|
"target": "attack",
|
||||||
"description": "Granted D6 (1-6) Attack Modifier for This Ranged Attack"
|
"description": "Granted D6 (1-6) Attack Modifier for This Ranged Attack"
|
||||||
},
|
},
|
||||||
"melee_defense": {
|
"melee_defense": {
|
||||||
"type": "luck_die", "scope": "combat",
|
"type": "luck_die",
|
||||||
|
"scope": "combat",
|
||||||
"description": "Granted 1 Luck dice for Use in This Combat Only"
|
"description": "Granted 1 Luck dice for Use in This Combat Only"
|
||||||
},
|
},
|
||||||
"arcane_spell_attack": {
|
"arcane_spell_attack": {
|
||||||
@@ -75,26 +176,42 @@
|
|||||||
"description": "No Spell Lethargy the Aether Approves of Characters Efforts"
|
"description": "No Spell Lethargy the Aether Approves of Characters Efforts"
|
||||||
},
|
},
|
||||||
"arcane_spell_defense": {
|
"arcane_spell_defense": {
|
||||||
"type": "flash_of_pain", "duration_dice": "1D6E", "target": "caster",
|
"type": "flash_of_pain",
|
||||||
|
"duration_dice": "1D6E",
|
||||||
|
"target": "caster",
|
||||||
"description": "Caster Suffers Severe pain and will be under a flash of pain for 1D6E seconds"
|
"description": "Caster Suffers Severe pain and will be under a flash of pain for 1D6E seconds"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "luck_die",
|
||||||
|
"scope": "combat",
|
||||||
|
"description": "Granted 1 Luck dice for Use in This Combat Only"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"26": {
|
"26": {
|
||||||
"melee_attack": { "type": "shield_destruction", "description": "Shield Destruction" }
|
"melee_attack": {
|
||||||
|
"type": "shield_destruction",
|
||||||
|
"description": "Shield Destruction"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"25": {
|
"25": {
|
||||||
"skill_rolls": {
|
"skill_rolls": {
|
||||||
"type": "bonus_flat", "amount": 1, "target": "skill",
|
"type": "bonus_flat",
|
||||||
|
"amount": 1,
|
||||||
|
"target": "skill",
|
||||||
"description": "Add 1 to Skill Roll"
|
"description": "Add 1 to Skill Roll"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"21": {
|
"21": {
|
||||||
"melee_attack": {
|
"melee_attack": {
|
||||||
"type": "flash_of_pain", "duration_dice": "1D6E", "target": "defender",
|
"type": "flash_of_pain",
|
||||||
|
"duration_dice": "1D6E",
|
||||||
|
"target": "defender",
|
||||||
"description": "Hit Inflicts Flash of Pain 1D6E seconds"
|
"description": "Hit Inflicts Flash of Pain 1D6E seconds"
|
||||||
},
|
},
|
||||||
"ranged_attack": {
|
"ranged_attack": {
|
||||||
"type": "flash_of_pain", "duration_dice": "1D6E", "target": "defender",
|
"type": "flash_of_pain",
|
||||||
|
"duration_dice": "1D6E",
|
||||||
|
"target": "defender",
|
||||||
"description": "Hit Inflicts Flash of Pain 1D6E seconds"
|
"description": "Hit Inflicts Flash of Pain 1D6E seconds"
|
||||||
},
|
},
|
||||||
"melee_defense": {
|
"melee_defense": {
|
||||||
@@ -102,176 +219,391 @@
|
|||||||
"description": "Defender Recovers or ignores any flash of pain"
|
"description": "Defender Recovers or ignores any flash of pain"
|
||||||
},
|
},
|
||||||
"arcane_spell_attack": {
|
"arcane_spell_attack": {
|
||||||
"type": "flash_of_pain", "duration_dice": "1D6E", "target": "defender",
|
"type": "flash_of_pain",
|
||||||
|
"duration_dice": "1D6E",
|
||||||
|
"target": "defender",
|
||||||
"description": "Magical Damage inflicts Flash of pain 1D6E seconds"
|
"description": "Magical Damage inflicts Flash of pain 1D6E seconds"
|
||||||
},
|
},
|
||||||
"arcane_spell_defense": {
|
"arcane_spell_defense": {
|
||||||
"type": "flash_of_pain", "duration_dice": "1D6E", "target": "caster",
|
"type": "flash_of_pain",
|
||||||
|
"duration_dice": "1D6E",
|
||||||
|
"target": "caster",
|
||||||
"description": "Caster Suffers Severe pain and will be under a flash of pain for 1D6E seconds"
|
"description": "Caster Suffers Severe pain and will be under a flash of pain for 1D6E seconds"
|
||||||
},
|
},
|
||||||
"skill_rolls": {
|
"skill_rolls": {
|
||||||
"type": "bonus_dice", "dice": "D6", "target": "skill",
|
"type": "bonus_dice",
|
||||||
|
"dice": "D6",
|
||||||
|
"target": "skill",
|
||||||
"description": "Granted D6 (1-6) Skill Modifier for this Skill Attempt"
|
"description": "Granted D6 (1-6) Skill Modifier for this Skill Attempt"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "recover_pain",
|
||||||
|
"description": "Defender Recovers or ignores any flash of pain"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"20": {
|
"20": {
|
||||||
"melee_attack": {
|
"melee_attack": {
|
||||||
"type": "choice",
|
"type": "choice",
|
||||||
"choices": [
|
"choices": [
|
||||||
{ "type": "special_strike", "options": ["vicious"] },
|
{
|
||||||
{ "type": "bonus_dice", "dice": "D12", "target": "attack" }
|
"type": "special_strike",
|
||||||
|
"options": [
|
||||||
|
"vicious"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D12",
|
||||||
|
"target": "attack"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"description": "Possible Vicious Strike or Add D12 to attack"
|
"description": "Possible Vicious Strike or Add D12 to attack"
|
||||||
},
|
},
|
||||||
"ranged_attack": {
|
"ranged_attack": {
|
||||||
"type": "choice",
|
"type": "choice",
|
||||||
"choices": [
|
"choices": [
|
||||||
{ "type": "special_strike", "options": ["vicious"] },
|
{
|
||||||
{ "type": "bonus_dice", "dice": "D12", "target": "attack" }
|
"type": "special_strike",
|
||||||
|
"options": [
|
||||||
|
"vicious"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D12",
|
||||||
|
"target": "attack"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"description": "Possible Vicious Strike or add D12 to attack"
|
"description": "Possible Vicious Strike or add D12 to attack"
|
||||||
},
|
},
|
||||||
"melee_defense": {
|
"melee_defense": {
|
||||||
"type": "choice",
|
"type": "choice",
|
||||||
"choices": [
|
"choices": [
|
||||||
{ "type": "special_defense", "options": ["perfect"] },
|
{
|
||||||
{ "type": "bonus_dice", "dice": "D12", "target": "defense" }
|
"type": "special_defense",
|
||||||
|
"options": [
|
||||||
|
"perfect"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D12",
|
||||||
|
"target": "defense"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"description": "Possible 20/20 defense that avoids Any Attack Except a Lethal Strike or adds D12 to defense"
|
"description": "Possible 20/20 defense that avoids Any Attack Except a Lethal Strike or adds D12 to defense"
|
||||||
},
|
},
|
||||||
"arcane_spell_attack": {
|
"arcane_spell_attack": {
|
||||||
"type": "choice",
|
"type": "choice",
|
||||||
"choices": [
|
"choices": [
|
||||||
{ "type": "special_strike", "options": ["vicious_magical"] },
|
{
|
||||||
{ "type": "bonus_dice", "dice": "D12", "target": "spell_attack" }
|
"type": "special_strike",
|
||||||
|
"options": [
|
||||||
|
"vicious_magical"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D12",
|
||||||
|
"target": "spell_attack"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"description": "Possible Vicious Application of a Magical Attack or add D12 to attack"
|
"description": "Possible Vicious Application of a Magical Attack or add D12 to attack"
|
||||||
},
|
},
|
||||||
"arcane_spell_defense": {
|
"arcane_spell_defense": {
|
||||||
"type": "choice",
|
"type": "choice",
|
||||||
"choices": [
|
"choices": [
|
||||||
{ "type": "special_defense", "options": ["perfect_spell"] },
|
{
|
||||||
{ "type": "bonus_dice", "dice": "D12", "target": "spell_defense" }
|
"type": "special_defense",
|
||||||
|
"options": [
|
||||||
|
"perfect_spell"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D12",
|
||||||
|
"target": "spell_defense"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"description": "Possible 20/20 Spell defense that Saves Against Any Magical Attack Except a Lethal Magical Strike or add D12 to defense"
|
"description": "Possible 20/20 Spell defense that Saves Against Any Magical Attack Except a Lethal Magical Strike or add D12 to defense"
|
||||||
},
|
},
|
||||||
"skill_rolls": {
|
"skill_rolls": {
|
||||||
"type": "bonus_flat", "amount": 20, "target": "skill",
|
"type": "bonus_flat",
|
||||||
|
"amount": 20,
|
||||||
|
"target": "skill",
|
||||||
"description": "20 Added to Skill Roll"
|
"description": "20 Added to Skill Roll"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "choice",
|
||||||
|
"choices": [
|
||||||
|
{
|
||||||
|
"type": "special_defense",
|
||||||
|
"options": [
|
||||||
|
"perfect"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D12",
|
||||||
|
"target": "defense"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Possible 20/20 defense that avoids Any Attack Except a Lethal Strike or adds D12 to defense"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"15": {
|
"15": {
|
||||||
"melee_attack": {
|
"melee_attack": {
|
||||||
"type": "combo",
|
"type": "combo",
|
||||||
"effects": [
|
"effects": [
|
||||||
{ "type": "bleed" },
|
{
|
||||||
{ "type": "knockback" }
|
"type": "bleed"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "knockback"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"description": "Bleed, Knock-back on Hit"
|
"description": "Bleed, Knock-back on Hit"
|
||||||
},
|
},
|
||||||
"ranged_attack": { "type": "bleed", "description": "Bleed" },
|
"ranged_attack": {
|
||||||
|
"type": "bleed",
|
||||||
|
"description": "Bleed"
|
||||||
|
},
|
||||||
"melee_defense": {
|
"melee_defense": {
|
||||||
"type": "counter_attack",
|
"type": "counter_attack",
|
||||||
"options": ["kick", "punch", "shield_bash"],
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch",
|
||||||
|
"shield_bash"
|
||||||
|
],
|
||||||
"description": "Kick, Punch or Shield Bash"
|
"description": "Kick, Punch or Shield Bash"
|
||||||
},
|
},
|
||||||
"skill_rolls": {
|
"skill_rolls": {
|
||||||
"type": "bonus_flat", "amount": 1, "target": "skill",
|
"type": "bonus_flat",
|
||||||
|
"amount": 1,
|
||||||
|
"target": "skill",
|
||||||
"description": "Add 1 to Skill Roll"
|
"description": "Add 1 to Skill Roll"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "counter_attack",
|
||||||
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch",
|
||||||
|
"shield_bash"
|
||||||
|
],
|
||||||
|
"description": "Kick, Punch or Shield Bash"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"13": {},
|
"13": {},
|
||||||
"11": {
|
"11": {
|
||||||
"melee_attack": {
|
"melee_attack": {
|
||||||
"type": "flurry", "condition": "hit_or_miss",
|
"type": "flurry",
|
||||||
|
"condition": "hit_or_miss",
|
||||||
"description": "Flurry Attack or Hit to Miss"
|
"description": "Flurry Attack or Hit to Miss"
|
||||||
},
|
},
|
||||||
"ranged_attack": { "type": "double_damage_dice", "description": "Roll 2x Damage Dice" }
|
"ranged_attack": {
|
||||||
|
"type": "double_damage_dice",
|
||||||
|
"description": "Roll 2x Damage Dice"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"10": {
|
"10": {
|
||||||
"melee_attack": {
|
"melee_attack": {
|
||||||
"type": "combo",
|
"type": "combo",
|
||||||
"effects": [
|
"effects": [
|
||||||
{ "type": "bleed" },
|
{
|
||||||
{ "type": "knockback" }
|
"type": "bleed"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "knockback"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"description": "Bleed, Knock-back on Hit"
|
"description": "Bleed, Knock-back on Hit"
|
||||||
},
|
},
|
||||||
"ranged_attack": { "type": "bleed", "description": "Bleed" },
|
"ranged_attack": {
|
||||||
|
"type": "bleed",
|
||||||
|
"description": "Bleed"
|
||||||
|
},
|
||||||
"melee_defense": {
|
"melee_defense": {
|
||||||
"type": "counter_attack",
|
"type": "counter_attack",
|
||||||
"options": ["kick", "punch", "shield_bash"],
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch",
|
||||||
|
"shield_bash"
|
||||||
|
],
|
||||||
"description": "Kick, Punch or Shield Bash"
|
"description": "Kick, Punch or Shield Bash"
|
||||||
},
|
},
|
||||||
"skill_rolls": {
|
"skill_rolls": {
|
||||||
"type": "bonus_flat", "amount": 1, "target": "skill",
|
"type": "bonus_flat",
|
||||||
|
"amount": 1,
|
||||||
|
"target": "skill",
|
||||||
"description": "Add 1 to Skill Roll"
|
"description": "Add 1 to Skill Roll"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "counter_attack",
|
||||||
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch",
|
||||||
|
"shield_bash"
|
||||||
|
],
|
||||||
|
"description": "Kick, Punch or Shield Bash"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"8": {
|
"8": {
|
||||||
"melee_attack": { "type": "mulligan", "description": "Mulligan, Can Choose to Re-roll This Attack" },
|
"melee_attack": {
|
||||||
"ranged_attack": { "type": "mulligan", "description": "Mulligan, Can Choose to Re-Roll This Attack" },
|
"type": "mulligan",
|
||||||
"melee_defense": { "type": "mulligan", "description": "Mulligan, Can Choose to Re-Roll This Defense" },
|
"description": "Mulligan, Can Choose to Re-roll This Attack"
|
||||||
"arcane_spell_attack": { "type": "mulligan", "description": "Mulligan, Can Re-Roll This Spell Attack" },
|
},
|
||||||
"arcane_spell_defense": { "type": "mulligan", "description": "Mulligan, Can Re-Roll This Spell Defense" },
|
"ranged_attack": {
|
||||||
"skill_rolls": { "type": "mulligan", "description": "Mulligan, Can Re-Roll This Skill roll" }
|
"type": "mulligan",
|
||||||
|
"description": "Mulligan, Can Choose to Re-Roll This Attack"
|
||||||
|
},
|
||||||
|
"melee_defense": {
|
||||||
|
"type": "mulligan",
|
||||||
|
"description": "Mulligan, Can Choose to Re-Roll This Defense"
|
||||||
|
},
|
||||||
|
"arcane_spell_attack": {
|
||||||
|
"type": "mulligan",
|
||||||
|
"description": "Mulligan, Can Re-Roll This Spell Attack"
|
||||||
|
},
|
||||||
|
"arcane_spell_defense": {
|
||||||
|
"type": "mulligan",
|
||||||
|
"description": "Mulligan, Can Re-Roll This Spell Defense"
|
||||||
|
},
|
||||||
|
"skill_rolls": {
|
||||||
|
"type": "mulligan",
|
||||||
|
"description": "Mulligan, Can Re-Roll This Skill roll"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "mulligan",
|
||||||
|
"description": "Mulligan, Can Choose to Re-Roll This Defense"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"7": {
|
"7": {
|
||||||
"melee_attack": {
|
"melee_attack": {
|
||||||
"type": "flurry", "condition": "hit_or_miss",
|
"type": "flurry",
|
||||||
|
"condition": "hit_or_miss",
|
||||||
"description": "Flurry Attack on Hit or Miss"
|
"description": "Flurry Attack on Hit or Miss"
|
||||||
},
|
},
|
||||||
"ranged_attack": { "type": "double_damage_dice", "description": "Roll 2x Damage Dice" }
|
"ranged_attack": {
|
||||||
|
"type": "double_damage_dice",
|
||||||
|
"description": "Roll 2x Damage Dice"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"5": {
|
"5": {
|
||||||
"melee_attack": {
|
"melee_attack": {
|
||||||
"type": "combo",
|
"type": "combo",
|
||||||
"effects": [
|
"effects": [
|
||||||
{ "type": "bleed" },
|
{
|
||||||
{ "type": "knockback" }
|
"type": "bleed"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "knockback"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"description": "Bleed, Knock-back on Hit"
|
"description": "Bleed, Knock-back on Hit"
|
||||||
},
|
},
|
||||||
"ranged_attack": { "type": "bleed", "description": "Bleed" },
|
"ranged_attack": {
|
||||||
|
"type": "bleed",
|
||||||
|
"description": "Bleed"
|
||||||
|
},
|
||||||
"melee_defense": {
|
"melee_defense": {
|
||||||
"type": "counter_attack",
|
"type": "counter_attack",
|
||||||
"options": ["kick", "punch", "shield_bash"],
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch",
|
||||||
|
"shield_bash"
|
||||||
|
],
|
||||||
"description": "Kick, Punch, or Shield Bash"
|
"description": "Kick, Punch, or Shield Bash"
|
||||||
},
|
},
|
||||||
"skill_rolls": {
|
"skill_rolls": {
|
||||||
"type": "bonus_flat", "amount": 1, "target": "skill",
|
"type": "bonus_flat",
|
||||||
|
"amount": 1,
|
||||||
|
"target": "skill",
|
||||||
"description": "Add 1 to Skill Roll"
|
"description": "Add 1 to Skill Roll"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "counter_attack",
|
||||||
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch",
|
||||||
|
"shield_bash"
|
||||||
|
],
|
||||||
|
"description": "Kick, Punch, or Shield Bash"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"3": {
|
"3": {
|
||||||
"melee_attack": { "type": "damage_multiplier", "multiplier": 3, "description": "Triple Damage" },
|
"melee_attack": {
|
||||||
"ranged_attack": { "type": "damage_multiplier", "multiplier": 3, "description": "Triple Damage" },
|
"type": "damage_multiplier",
|
||||||
|
"multiplier": 3,
|
||||||
|
"description": "Triple Damage"
|
||||||
|
},
|
||||||
|
"ranged_attack": {
|
||||||
|
"type": "damage_multiplier",
|
||||||
|
"multiplier": 3,
|
||||||
|
"description": "Triple Damage"
|
||||||
|
},
|
||||||
"melee_defense": {
|
"melee_defense": {
|
||||||
"type": "dr_multiplier", "multiplier": 3, "includes_shield": true,
|
"type": "dr_multiplier",
|
||||||
|
"multiplier": 3,
|
||||||
|
"includes_shield": true,
|
||||||
"description": "DR Tripled including Shield"
|
"description": "DR Tripled including Shield"
|
||||||
},
|
},
|
||||||
"arcane_spell_attack": { "type": "damage_multiplier", "multiplier": 3, "description": "Triple Damage on Spell Damage" },
|
"arcane_spell_attack": {
|
||||||
|
"type": "damage_multiplier",
|
||||||
|
"multiplier": 3,
|
||||||
|
"description": "Triple Damage on Spell Damage"
|
||||||
|
},
|
||||||
"arcane_spell_defense": {
|
"arcane_spell_defense": {
|
||||||
"type": "bonus_dice", "dice": "D12", "target": "spell_defense",
|
"type": "bonus_dice",
|
||||||
|
"dice": "D12",
|
||||||
|
"target": "spell_defense",
|
||||||
"description": "D12 Added to Spell Defense Modifier"
|
"description": "D12 Added to Spell Defense Modifier"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "dr_multiplier",
|
||||||
|
"multiplier": 3,
|
||||||
|
"includes_shield": true,
|
||||||
|
"description": "DR Tripled including Shield"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"2": {
|
"2": {
|
||||||
"melee_attack": { "type": "damage_multiplier", "multiplier": 2, "description": "Double Damage" },
|
"melee_attack": {
|
||||||
"ranged_attack": { "type": "damage_multiplier", "multiplier": 2, "description": "Double Damage" },
|
"type": "damage_multiplier",
|
||||||
|
"multiplier": 2,
|
||||||
|
"description": "Double Damage"
|
||||||
|
},
|
||||||
|
"ranged_attack": {
|
||||||
|
"type": "damage_multiplier",
|
||||||
|
"multiplier": 2,
|
||||||
|
"description": "Double Damage"
|
||||||
|
},
|
||||||
"melee_defense": {
|
"melee_defense": {
|
||||||
"type": "dr_multiplier", "multiplier": 2, "includes_shield": true,
|
"type": "dr_multiplier",
|
||||||
|
"multiplier": 2,
|
||||||
|
"includes_shield": true,
|
||||||
"description": "DR Doubled including Shield"
|
"description": "DR Doubled including Shield"
|
||||||
},
|
},
|
||||||
"arcane_spell_attack": { "type": "damage_multiplier", "multiplier": 2, "description": "Double Damage on Spell Damage" },
|
"arcane_spell_attack": {
|
||||||
|
"type": "damage_multiplier",
|
||||||
|
"multiplier": 2,
|
||||||
|
"description": "Double Damage on Spell Damage"
|
||||||
|
},
|
||||||
"arcane_spell_defense": {
|
"arcane_spell_defense": {
|
||||||
"type": "bonus_dice", "dice": "D6", "target": "spell_defense",
|
"type": "bonus_dice",
|
||||||
|
"dice": "D6",
|
||||||
|
"target": "spell_defense",
|
||||||
"description": "D6 Added to Spell Defense Modifier"
|
"description": "D6 Added to Spell Defense Modifier"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "dr_multiplier",
|
||||||
|
"multiplier": 2,
|
||||||
|
"includes_shield": true,
|
||||||
|
"description": "DR Doubled including Shield"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"1": {
|
"1": {
|
||||||
"ranged_attack": {
|
"ranged_attack": {
|
||||||
"type": "fumble", "detail": "ranged_ammo_broken",
|
"type": "fumble",
|
||||||
|
"detail": "ranged_ammo_broken",
|
||||||
"description": "Possible Fumble Ranged ammo is broken unrecoverable"
|
"description": "Possible Fumble Ranged ammo is broken unrecoverable"
|
||||||
},
|
},
|
||||||
"arcane_spell_attack": {
|
"arcane_spell_attack": {
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ export const DICE_VALUES = {
|
|||||||
export const CHARACTERISTIC_ATTACK = ["str", "int", "wis", "dex"]
|
export const CHARACTERISTIC_ATTACK = ["str", "int", "wis", "dex"]
|
||||||
export const CHARACTERISTIC_RANGED_ATTACK = ["int", "wis", "dex"]
|
export const CHARACTERISTIC_RANGED_ATTACK = ["int", "wis", "dex"]
|
||||||
export const CHARACTERISTIC_DEFENSE = ["int", "wis", "dex"]
|
export const CHARACTERISTIC_DEFENSE = ["int", "wis", "dex"]
|
||||||
|
export const CHARACTERISTIC_RANGED_DEFENSE = ["int", "wis", "dex"]
|
||||||
export const CHARACTERISTIC_DAMAGE = ["str"]
|
export const CHARACTERISTIC_DAMAGE = ["str"]
|
||||||
|
|
||||||
export const DEFENSE_DICE_VALUES = {
|
export const DEFENSE_DICE_VALUES = {
|
||||||
@@ -304,6 +305,7 @@ export const SYSTEM = {
|
|||||||
CHARACTERISTIC_ATTACK,
|
CHARACTERISTIC_ATTACK,
|
||||||
CHARACTERISTIC_RANGED_ATTACK,
|
CHARACTERISTIC_RANGED_ATTACK,
|
||||||
CHARACTERISTIC_DEFENSE,
|
CHARACTERISTIC_DEFENSE,
|
||||||
|
CHARACTERISTIC_RANGED_DEFENSE,
|
||||||
CHARACTERISTIC_DAMAGE,
|
CHARACTERISTIC_DAMAGE,
|
||||||
INITIATIVE_DICE_CHOICES_PER_CLASS,
|
INITIATIVE_DICE_CHOICES_PER_CLASS,
|
||||||
CHAR_CLASSES,
|
CHAR_CLASSES,
|
||||||
|
|||||||
@@ -256,6 +256,8 @@ export default class LethalFantasyActor extends Actor {
|
|||||||
if (rollType === "weapon-defense") {
|
if (rollType === "weapon-defense") {
|
||||||
rollTarget.armorDefense = this.getArmorDefenseValue()
|
rollTarget.armorDefense = this.getArmorDefenseValue()
|
||||||
rollTarget.grantedDice = this.system.granted.defenseDice
|
rollTarget.grantedDice = this.system.granted.defenseDice
|
||||||
|
// Check if this is a ranged defense
|
||||||
|
rollTarget.isRangedDefense = game.lethalFantasy?.nextDefenseData?.isRanged ?? false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export default class D30Roll {
|
|||||||
MELEE_ATTACK: "melee_attack",
|
MELEE_ATTACK: "melee_attack",
|
||||||
RANGED_ATTACK: "ranged_attack",
|
RANGED_ATTACK: "ranged_attack",
|
||||||
MELEE_DEFENSE: "melee_defense",
|
MELEE_DEFENSE: "melee_defense",
|
||||||
|
RANGED_DEFENSE: "ranged_defense",
|
||||||
ARCANE_SPELL_ATTACK: "arcane_spell_attack",
|
ARCANE_SPELL_ATTACK: "arcane_spell_attack",
|
||||||
ARCANE_SPELL_DEFENSE: "arcane_spell_defense",
|
ARCANE_SPELL_DEFENSE: "arcane_spell_defense",
|
||||||
SKILL_ROLLS: "skill_rolls"
|
SKILL_ROLLS: "skill_rolls"
|
||||||
@@ -51,9 +52,11 @@ export default class D30Roll {
|
|||||||
* @param {number} diceValue La valeur du dé (1-30)
|
* @param {number} diceValue La valeur du dé (1-30)
|
||||||
* @param {string} rollType Le type de jet externe (ex: "weapon-attack", "spell-attack", etc.)
|
* @param {string} rollType Le type de jet externe (ex: "weapon-attack", "spell-attack", etc.)
|
||||||
* @param {Object} weapon L'arme ou l'objet utilisé (optionnel, nécessaire pour certains types)
|
* @param {Object} weapon L'arme ou l'objet utilisé (optionnel, nécessaire pour certains types)
|
||||||
|
* @param {Object} options Options supplémentaires (optionnel)
|
||||||
|
* @param {boolean} options.isRanged Si true, utilise ranged_defense au lieu de melee_defense
|
||||||
* @returns {Object|null} L'objet effet `{ type, description, ...fields }` ou null si aucun effet
|
* @returns {Object|null} L'objet effet `{ type, description, ...fields }` ou null si aucun effet
|
||||||
*/
|
*/
|
||||||
static getResult(diceValue, rollType, weapon = null) {
|
static getResult(diceValue, rollType, weapon = null, options = {}) {
|
||||||
if (!this.resultsTable) {
|
if (!this.resultsTable) {
|
||||||
console.warn("D30Roll | Results table is not initialized. Call D30Roll.initialize() first.")
|
console.warn("D30Roll | Results table is not initialized. Call D30Roll.initialize() first.")
|
||||||
return null
|
return null
|
||||||
@@ -64,7 +67,7 @@ export default class D30Roll {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
const internalType = this.convertToInternalType(rollType, weapon)
|
const internalType = this.convertToInternalType(rollType, weapon, options)
|
||||||
|
|
||||||
if (!internalType) {
|
if (!internalType) {
|
||||||
console.warn(`D30Roll | Could not convert roll type: ${rollType}`)
|
console.warn(`D30Roll | Could not convert roll type: ${rollType}`)
|
||||||
@@ -99,9 +102,11 @@ export default class D30Roll {
|
|||||||
* Convertit un rollType externe en rollType interne
|
* Convertit un rollType externe en rollType interne
|
||||||
* @param {string} externalType Le type de jet externe (ex: "weapon-attack")
|
* @param {string} externalType Le type de jet externe (ex: "weapon-attack")
|
||||||
* @param {Object} weapon L'arme ou l'objet utilisé (optionnel)
|
* @param {Object} weapon L'arme ou l'objet utilisé (optionnel)
|
||||||
|
* @param {Object} options Options supplémentaires (optionnel)
|
||||||
|
* @param {boolean} options.isRanged Si true, utilise ranged_defense au lieu de melee_defense
|
||||||
* @returns {string|null} Le type interne correspondant ou null
|
* @returns {string|null} Le type interne correspondant ou null
|
||||||
*/
|
*/
|
||||||
static convertToInternalType(externalType, weapon = null) {
|
static convertToInternalType(externalType, weapon = null, options = {}) {
|
||||||
// Attack types - need weapon to determine if melee or ranged
|
// Attack types - need weapon to determine if melee or ranged
|
||||||
if (externalType === "weapon-attack") {
|
if (externalType === "weapon-attack") {
|
||||||
if (!weapon) {
|
if (!weapon) {
|
||||||
@@ -124,7 +129,7 @@ export default class D30Roll {
|
|||||||
|
|
||||||
// Defense types
|
// Defense types
|
||||||
if (externalType === "weapon-defense" || externalType === "monster-defense") {
|
if (externalType === "weapon-defense" || externalType === "monster-defense") {
|
||||||
return this.ROLL_TYPES.MELEE_DEFENSE
|
return options.isRanged ? this.ROLL_TYPES.RANGED_DEFENSE : this.ROLL_TYPES.MELEE_DEFENSE
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spell types
|
// Spell types
|
||||||
@@ -190,11 +195,12 @@ export default class D30Roll {
|
|||||||
* @param {number} diceValue La valeur du dé (1-30)
|
* @param {number} diceValue La valeur du dé (1-30)
|
||||||
* @param {string} rollType Le type de jet externe
|
* @param {string} rollType Le type de jet externe
|
||||||
* @param {Object} weapon L'arme ou l'objet utilisé (optionnel)
|
* @param {Object} weapon L'arme ou l'objet utilisé (optionnel)
|
||||||
|
* @param {Object} options Options supplémentaires (optionnel)
|
||||||
* @returns {Object} Un objet avec le résultat et des informations de formatage
|
* @returns {Object} Un objet avec le résultat et des informations de formatage
|
||||||
*/
|
*/
|
||||||
static getFormattedResult(diceValue, rollType, weapon = null) {
|
static getFormattedResult(diceValue, rollType, weapon = null, options = {}) {
|
||||||
const result = this.getResult(diceValue, rollType, weapon)
|
const result = this.getResult(diceValue, rollType, weapon, options)
|
||||||
const internalType = this.convertToInternalType(rollType, weapon)
|
const internalType = this.convertToInternalType(rollType, weapon, options)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
value: diceValue,
|
value: diceValue,
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
} else {
|
} else {
|
||||||
options.rollTarget.value = options.rollTarget.defenseModifier
|
options.rollTarget.value = options.rollTarget.defenseModifier
|
||||||
options.rollTarget.charModifier = 0
|
options.rollTarget.charModifier = 0
|
||||||
|
options.isRangedDefense = options.rollTarget.isRangedDefense ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (options.rollType === "monster-skill") {
|
} else if (options.rollType === "monster-skill") {
|
||||||
@@ -219,8 +220,14 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
options.rollTarget.charModifier = options.rollTarget.combat.rangedAttackModifier
|
options.rollTarget.charModifier = options.rollTarget.combat.rangedAttackModifier
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
options.rollTarget.value = options.rollTarget.combat.defenseModifier + options.rollTarget.weaponSkillModifier + options.rollTarget.weapon.system.bonuses.defenseBonus + options.rollTarget.armorDefense
|
// For defense, check if it's a ranged defense
|
||||||
options.rollTarget.charModifier = options.rollTarget.combat.defenseModifier
|
const defenseModifier = options.rollTarget.isRangedDefense
|
||||||
|
? options.rollTarget.combat.rangedDefenseModifier
|
||||||
|
: options.rollTarget.combat.defenseModifier
|
||||||
|
options.rollTarget.value = defenseModifier + options.rollTarget.weaponSkillModifier + options.rollTarget.weapon.system.bonuses.defenseBonus + options.rollTarget.armorDefense
|
||||||
|
options.rollTarget.charModifier = defenseModifier
|
||||||
|
// Store isRanged flag for D30 lookup
|
||||||
|
options.isRangedDefense = options.rollTarget.isRangedDefense
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (options.rollType === "spell" || options.rollType === "spell-attack" || options.rollType === "spell-power") {
|
} else if (options.rollType === "spell" || options.rollType === "spell-attack" || options.rollType === "spell-power") {
|
||||||
@@ -577,7 +584,8 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
const d30Message = D30Roll.getResult(
|
const d30Message = D30Roll.getResult(
|
||||||
rollD30.total,
|
rollD30.total,
|
||||||
options.rollType,
|
options.rollType,
|
||||||
options.rollTarget?.weapon
|
options.rollTarget?.weapon,
|
||||||
|
{ isRanged: options.isRangedDefense }
|
||||||
)
|
)
|
||||||
options.D30message = d30Message
|
options.D30message = d30Message
|
||||||
}
|
}
|
||||||
@@ -1113,7 +1121,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
await rollBase.evaluate()
|
await rollBase.evaluate()
|
||||||
let rollD30 = await new Roll("1D30").evaluate()
|
let rollD30 = await new Roll("1D30").evaluate()
|
||||||
options.D30result = rollD30.total
|
options.D30result = rollD30.total
|
||||||
options.D30message = D30Roll.getResult(rollD30.total, options.rollType, options.rollTarget?.weapon)
|
options.D30message = D30Roll.getResult(rollD30.total, options.rollType, options.rollTarget?.weapon, { isRanged: true })
|
||||||
|
|
||||||
let badResult = 0
|
let badResult = 0
|
||||||
if (rollContext.movement.includes("kh")) {
|
if (rollContext.movement.includes("kh")) {
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
attackModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
attackModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
rangedAttackModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
rangedAttackModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
defenseModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
defenseModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
|
rangedDefenseModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
defenseBonus: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
defenseBonus: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
damageModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
damageModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
armorHitPoints: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
armorHitPoints: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
@@ -259,6 +260,12 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
this.combat.defenseModifier += chaDef.defense
|
this.combat.defenseModifier += chaDef.defense
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.combat.rangedDefenseModifier = this.combat.defenseBonus
|
||||||
|
for (let chaKey of SYSTEM.CHARACTERISTIC_RANGED_DEFENSE) {
|
||||||
|
let chaDef = SYSTEM.CHARACTERISTICS_TABLES[chaKey].find(s => s.value === this.characteristics[chaKey].value)
|
||||||
|
this.combat.rangedDefenseModifier += chaDef.defense
|
||||||
|
}
|
||||||
|
|
||||||
this.combat.damageModifier = 0
|
this.combat.damageModifier = 0
|
||||||
for (let chaKey of SYSTEM.CHARACTERISTIC_DAMAGE) {
|
for (let chaKey of SYSTEM.CHARACTERISTIC_DAMAGE) {
|
||||||
let chaDef = SYSTEM.CHARACTERISTICS_TABLES[chaKey].find(s => s.value === this.characteristics[chaKey].value)
|
let chaDef = SYSTEM.CHARACTERISTICS_TABLES[chaKey].find(s => s.value === this.characteristics[chaKey].value)
|
||||||
|
|||||||
@@ -182,6 +182,9 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
const attacksSet = this.attackMode === "ranged" ? this.rangedAttacks : this.attacks
|
const attacksSet = this.attackMode === "ranged" ? this.rangedAttacks : this.attacks
|
||||||
rollTarget = foundry.utils.duplicate(attacksSet[rollKey])
|
rollTarget = foundry.utils.duplicate(attacksSet[rollKey])
|
||||||
rollTarget.rollKey = rollKey
|
rollTarget.rollKey = rollKey
|
||||||
|
if (rollType === "monster-defense") {
|
||||||
|
rollTarget.isRangedDefense = game.lethalFantasy?.nextDefenseData?.isRanged ?? false
|
||||||
|
}
|
||||||
// Si damageModifier est fourni (depuis le chat), l'utiliser au lieu de celui de la fiche
|
// Si damageModifier est fourni (depuis le chat), l'utiliser au lieu de celui de la fiche
|
||||||
if (damageModifier !== undefined && rollType === "monster-damage") {
|
if (damageModifier !== undefined && rollType === "monster-damage") {
|
||||||
rollTarget.damageModifier = damageModifier
|
rollTarget.damageModifier = damageModifier
|
||||||
|
|||||||
+4
-2
@@ -366,7 +366,8 @@ export default class LethalFantasyUtils {
|
|||||||
attackD30message,
|
attackD30message,
|
||||||
attackRerollContext,
|
attackRerollContext,
|
||||||
defenderId: defender.id,
|
defenderId: defender.id,
|
||||||
defenderTokenId
|
defenderTokenId,
|
||||||
|
isRanged: msg.isRanged
|
||||||
}
|
}
|
||||||
|
|
||||||
defender.system.prepareMonsterRoll("monster-defense", result)
|
defender.system.prepareMonsterRoll("monster-defense", result)
|
||||||
@@ -438,7 +439,8 @@ export default class LethalFantasyUtils {
|
|||||||
attackD30message,
|
attackD30message,
|
||||||
attackRerollContext,
|
attackRerollContext,
|
||||||
defenderId: defender.id,
|
defenderId: defender.id,
|
||||||
defenderTokenId
|
defenderTokenId,
|
||||||
|
isRanged: msg.isRanged
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Storing defense data for character:", defender.id)
|
console.log("Storing defense data for character:", defender.id)
|
||||||
|
|||||||
Reference in New Issue
Block a user