PDA

View Full Version : Help With Effects and Damage Types



leozelig
May 21st, 2015, 12:01
I am trying to incorporate effects and damage types for my DCC RPG ruleset. I have honed in on damage types in the code.

I am using 3.5E as a model. Does anyone know which files/scripts contain the effects code? I know about the following:

actions_manager_attack
actions_manager_damage
manager_actor2
manager_combat2
manager_effect
data_common

Is there anything I am missing? I am referring specifically to effects like "ATK:2" and "SAVE:1" etc., not so much to conditions like "Prone" and "Sickened"...

Trenloe
May 21st, 2015, 18:43
I'm not at a computer now so can't check. There will be a different actions_manager_xxxx script for saves.

Trenloe
May 21st, 2015, 20:30
Saves are in manager_action_spell.lua - starting with performSaveRoll.

leozelig
May 21st, 2015, 21:42
Oh yeah, saves. Thanks, Trenloe. I removed some of the effects/damage types from the data_common file and got an error about the function 'contains' getting a nil value. So I am just trying to get a better feel for how it's set up.

leozelig
May 22nd, 2015, 04:48
Does the Castles & Crusades ruleset parse range and damage type info from the CT attack line? It doesn't seem like it, but maybe I am using the wrong string format.

leozelig
May 22nd, 2015, 05:31
I figured out another solution. I was using the C&C format for PC weapons and 3.5E format for NPC attacks. I figured out how to structure the data so the damage functions work properly. It looks like dragging attacks/damage onto tokens is working, and token effect/health icons seem to be working as well. I am using the client CT wound categories from 3.5E, so the whole disabled/dying/dead thing isn't quite DCC RPG, although I did get rid of stabilization rolls.

I just need to run through the effects that auto-apply roll modifiers to make sure they match up with DCC RPG, which really only has a few. Also, cover is just one category, but I will continue to work on the effects after the ruleset is posted...

leozelig
May 23rd, 2015, 16:46
I have modeled my ParseAttackLine function after 3.5E, but I want to eliminate the critical hit multiplier, since DCC RPG uses a crit table instead. I want my attack line to read:


Sword +1 melee (1d8+1/19-20)

where the label+bonus = Sword +1, range = melee, damage die+mod = 1d8+1, and crit range (if specified) = /19-20. If specified, damage type would follow the damage dice+mod (1d8+1 fire/19-20). So, in scripts/manager_combat2, I have the following:


nPhraseStart, nPhraseEnd, sAll, sAttackCount, sAttackLabel, sAttackModifier, sAttackType, nDamageStart, sDamage, nDamageEnd
= string.find(sPhrase, '((%+?%d*) ?([%w%s,%[%]%(%)%+%-]*) ([%+%-%d][%+%-%d/]+)([^%(]*)%(()([^%)]*)()%))');


I think I can just leave that line alone. I was going to remove the following section in red because I do not need a crit multiplier:


local aWordDice, nWordMod = StringManager.convertStringToDice(sDamageRoll);
if #aWordDice > 0 or nWordMod ~= 0 then
local rDamageClause = { dice = {} };
for kDie, vDie in ipairs(aWordDice) do
table.insert(rDamageClause.dice, vDie);
end
rDamageClause.modifier = nWordMod;


if kClause == 1 then
rDamageClause.mult = 2;
else
rDamageClause.mult = 1;
end
rDamageClause.mult = tonumber(sCrit) or rDamageClause.mult;

if not bRanged then
rDamageClause.stat = "strength";
end


local aDamageType = ActionDamage.getDamageTypesFromString(table.concat (aWordType, ","));
rDamageClause.dmgtype = table.concat(aDamageType, ",");

table.insert(rDamage.clauses, rDamageClause);
end



Another segment I am not fully understanding, and I think it is because I don't know 3.5E rules that well, is this:



if #(rDamage.clauses) > 0 then
if bRanged then
local nDmgBonus = rDamage.clauses[1].modifier;
if nDmgBonus > 0 then
local nStatBonus = ActorManager2.getAbilityBonus(rActor, "strength");
if (nDmgBonus >= nStatBonus) then
rDamage.statmult = 1;
end
end
else
local nDmgBonus = rDamage.clauses[1].modifier;
local nStatBonus = ActorManager2.getAbilityBonus(rActor, "strength");

if (nStatBonus > 0) and (nDmgBonus > 0) then
if nDmgBonus >= math.floor(nStatBonus * 1.5) then
rDamage.statmult = 1.5;
elseif nDmgBonus >= nStatBonus then
rDamage.statmult = 1;
else
rDamage.statmult = 0.5;
end
elseif (nStatBonus == 1) and (nDmgBonus == 0) then
rDamage.statmult = 0.5;
end
end
end




I do not know what rDamage.statmult is exactly, but I am pretty certain that I do not need it.

Currently, I have the following known issues with the ruleset, but I am working on it:



Critical hit threshold not calculating properly for NPCs if not rolled with a d20. I have a couple target conditions that bump the attack die up from a d20 to a d24 (e.g. Entangled), but FG is counting rolls of 20-24 as critical hits instead of just 24.
Two weapon fighting does not disable an expanded critical threat range. This only applies to warriors, so I will get to it eventually.
Damage types for PCs always post as (TYPE: untyped XX+X=XX). I need to figure out how to remove the 'TYPE: untyped', which I will get to eventually.


I want to get the attack line parsing cleaned up first. I am going to post the ruleset before these issues are fixed though...

leozelig
May 23rd, 2015, 18:10
Actually I am keeping rDamage.statmult. I don't fully understand it, but I know it matters for NPCs that have ability scores.

Does 3.5E allow the attack die to be specified? For example,

Sword d20+1 melee (1d8+1)

I would like to be able to do that if possible. Parsing is not my forte, I am finding.

I did remove rDamage.mult without any obvious bugs. My code is still really cluttered right now...

Trenloe
May 26th, 2015, 18:37
Actually I am keeping rDamage.statmult. I don't fully understand it, but I know it matters for NPCs that have ability scores.
It's used for adding 1.5 x STR bonus for attacking with a two handed weapon and for adding 0.5 x STR bonus for attacking with a weapon off-hand when two weapon fighting.


Does 3.5E allow the attack die to be specified? For example,

Sword d20+1 melee (1d8+1)
Nope. As 3.5E always uses a d20 to attack. You'd have to customise this yourself.