public Effect DeepCopy() { Effect copy = new Effect(); copy.name = this.name; copy.tag = this.tag; copy.tagOfSender = this.tagOfSender; copy.description = this.description; copy.spriteFilename = this.spriteFilename; copy.durationInUnits = this.durationInUnits; copy.currentDurationInUnits = this.currentDurationInUnits; copy.startingTimeInUnits = this.startingTimeInUnits; copy.babModifier = this.babModifier; copy.acModifier = this.acModifier; copy.isStackableEffect = this.isStackableEffect; copy.isStackableDuration = this.isStackableDuration; copy.usedForUpdateStats = this.usedForUpdateStats; copy.effectLetter = this.effectLetter; copy.effectLetterColor = this.effectLetterColor; copy.effectScript = this.effectScript; return copy; }
public void AddEffectByObject(Effect effect, int startTime) { Effect ef = effect.DeepCopy(); ef.startingTimeInUnits = startTime; //mod.WorldTime; //stackable effect and duration (just add effect to list) if (ef.isStackableEffect) { //add to the list AddEffect(ef); } //stackable duration (add to list if not there, if there add to duration) else if ((!ef.isStackableEffect) && (ef.isStackableDuration)) { if (!IsInEffectList(ef.tag)) //Not in list so add to list { AddEffect(ef); } else //is in list so add durations together { Effect e = this.getEffectByTag(ef.tag); e.durationInUnits += ef.durationInUnits; } } //none stackable (add to list if not there) else if ((!ef.isStackableEffect) && (!ef.isStackableDuration)) { if (!IsInEffectList(ef.tag)) //Not in list so add to list { AddEffect(ef); } else //is in list so reset duration { Effect e = this.getEffectByTag(ef.tag); e.startingTimeInUnits = startTime; e.currentDurationInUnits = 0; } } }
public void AddEffect(Effect ef) { this.cr_effectsList.Add(ef); }
public Effect DeepCopy() { Effect copy = new Effect(); copy.thisEffectUsesFullSizeIcon = this.thisEffectUsesFullSizeIcon; copy.onSquarePersistenceBonus = this.onSquarePersistenceBonus; copy.squareIndicatorFilename = this.squareIndicatorFilename; copy.durationOnSquareInUnits = this.durationOnSquareInUnits; copy.triggeredEachStepToo = this.triggeredEachStepToo; copy.allowCastingWithoutRiskOfInterruption = this.allowCastingWithoutRiskOfInterruption; copy.allowCastingWithoutTriggeringAoO = this.allowCastingWithoutTriggeringAoO; copy.name = this.name; copy.tag = this.tag; //copy.shortText = this.shortText; copy.tagOfSender = this.tagOfSender; copy.classLevelOfSender = this.classLevelOfSender; copy.description = this.description; copy.spriteFilename = this.spriteFilename; copy.durationInUnits = this.durationInUnits; copy.currentDurationInUnits = this.currentDurationInUnits; copy.startingTimeInUnits = this.startingTimeInUnits; copy.babModifier = this.babModifier; copy.acModifier = this.acModifier; copy.babModifierForRangedAttack = this.babModifierForRangedAttack; copy.babModifierForMeleeAttack = this.babModifierForMeleeAttack; copy.damageModifierForMeleeAttack = this.damageModifierForMeleeAttack; copy.damageModifierForRangedAttack = this.damageModifierForRangedAttack; copy.isStackableEffect = this.isStackableEffect; copy.isStackableDuration = this.isStackableDuration; copy.usedForUpdateStats = this.usedForUpdateStats; copy.effectLetter = this.effectLetter; copy.effectLetterColor = this.effectLetterColor; copy.effectScript = this.effectScript; copy.saveCheckType = this.saveCheckType; copy.saveCheckDC = this.saveCheckDC; copy.combatLocX = this.combatLocX; copy.combatLocY = this.combatLocY; copy.doBuff = this.doBuff; copy.doDamage = this.doDamage; copy.doDeBuff = this.doDeBuff; copy.doHeal = this.doHeal; copy.healHP = this.healHP; copy.damType = this.damType; copy.damNumOfDice = this.damNumOfDice; copy.damDie = this.damDie; copy.damAdder = this.damAdder; copy.damAttacksEveryNLevels = this.damAttacksEveryNLevels; copy.damAttacksAfterLevelN = this.damAttacksAfterLevelN; copy.damAttacksUpToNLevelsTotal = this.damAttacksUpToNLevelsTotal; copy.damNumberOfAttacks = this.damNumberOfAttacks; copy.damNumberOfAttacksForEveryNLevels = this.damNumberOfAttacksForEveryNLevels; copy.damNumberOfAttacksAfterLevelN = this.damNumberOfAttacksAfterLevelN; copy.damNumberOfAttacksUpToNAttacksTotal = this.damNumberOfAttacksUpToNAttacksTotal; copy.healType = this.healType; copy.healNumOfDice = this.healNumOfDice; copy.healDie = this.healDie; copy.healAdder = this.healAdder; copy.healActionsEveryNLevels = this.healActionsEveryNLevels; copy.healActionsAfterLevelN = this.healActionsAfterLevelN; copy.healActionsUpToNLevelsTotal = this.healActionsUpToNLevelsTotal; copy.statusType = this.statusType; copy.modifyFortitude = this.modifyFortitude; copy.modifyWill = this.modifyWill; copy.modifyReflex = this.modifyReflex; copy.modifyStr = this.modifyStr; copy.modifyDex = this.modifyDex; copy.modifyInt = this.modifyInt; copy.modifyCha = this.modifyCha; copy.modifyCon = this.modifyCon; copy.modifyWis = this.modifyWis; copy.modifyLuk = this.modifyLuk; copy.modifyMoveDistance = this.modifyMoveDistance; copy.modifyHpMax = this.modifyHpMax; copy.modifySpMax = this.modifySpMax; copy.modifySp = this.modifySp; copy.modifyHpInCombat = this.modifyHpInCombat; copy.modifySpInCombat = this.modifySpInCombat; copy.modifyDamageTypeResistanceAcid = this.modifyDamageTypeResistanceAcid; copy.modifyDamageTypeResistanceCold = this.modifyDamageTypeResistanceCold; copy.modifyDamageTypeResistanceNormal = this.modifyDamageTypeResistanceNormal; copy.modifyDamageTypeResistanceElectricity = this.modifyDamageTypeResistanceElectricity; copy.modifyDamageTypeResistanceFire = this.modifyDamageTypeResistanceFire; copy.modifyDamageTypeResistanceMagic = this.modifyDamageTypeResistanceMagic; copy.modifyDamageTypeResistancePoison = this.modifyDamageTypeResistancePoison; copy.modifyNumberOfMeleeAttacks = this.modifyNumberOfMeleeAttacks; copy.modifyNumberOfRangedAttacks = this.modifyNumberOfRangedAttacks; copy.modifyNumberOfEnemiesAttackedOnCleave = this.modifyNumberOfEnemiesAttackedOnCleave; copy.modifyNumberOfEnemiesAttackedOnSweepAttack = this.modifyNumberOfEnemiesAttackedOnSweepAttack; copy.useDexterityForMeleeAttackModifierIfGreaterThanStrength = this.useDexterityForMeleeAttackModifierIfGreaterThanStrength; copy.useDexterityForMeleeDamageModifierIfGreaterThanStrength = this.useDexterityForMeleeDamageModifierIfGreaterThanStrength; copy.negateAttackPenaltyForAdjacentEnemyWithRangedAttack = this.negateAttackPenaltyForAdjacentEnemyWithRangedAttack; copy.useEvasion = this.useEvasion; copy.modifyShopBuyBackPrice = this.modifyShopBuyBackPrice; copy.modifyShopSellPrice = this.modifyShopSellPrice; copy.isPermanent = this.isPermanent; copy.endEffectWhenCarrierTakesDamage = this.endEffectWhenCarrierTakesDamage; copy.repeatTerminalSaveEachRound = this.repeatTerminalSaveEachRound; copy.saveOnlyHalvesDamage = this.saveOnlyHalvesDamage; copy.affectOnlyList = new List <LocalImmunityString>(); foreach (LocalImmunityString s in this.affectOnlyList) { copy.affectOnlyList.Add(s); } copy.affectNeverList = new List <LocalImmunityString>(); foreach (LocalImmunityString s in this.affectNeverList) { copy.affectNeverList.Add(s); } copy.traitWorksOnlyWhen = new List <LocalImmunityString>(); foreach (LocalImmunityString s in this.traitWorksOnlyWhen) { copy.traitWorksOnlyWhen.Add(s); } copy.traitWorksNeverWhen = new List <LocalImmunityString>(); foreach (LocalImmunityString s in this.traitWorksNeverWhen) { copy.traitWorksNeverWhen.Add(s); } return(copy); }