public CustomBodyDefinition(CustomSurvivor survivor, string commonName, string survivorNameToken) { CommonName = commonName; SurvivorNameToken = survivorNameToken; BaseMaxHealth = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "BaseMaxHealth", 0f, commonName + ": The base health of your survivor"), "baseMaxHealth"); BaseRegen = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "BaseRegen", 0f, commonName + ": The base regen of your survivor"), "baseRegen"); BaseMaxShield = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "BaseMaxShield", 0f, commonName + ": the base max shield of you survivor"), "baseMaxShield"); BaseMoveSpeed = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "BaseMoveSpeed", 0f, commonName + ": The base move speed of your survivor"), "baseMoveSpeed"); BaseAcceleration = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "BaseAcceleration", 0f, commonName + ": The base acceleration of your survivor"), "baseAcceleration"); BaseJumpPower = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "BaseJumpPower", 0f, commonName + ": The base jump power of your survivor"), "baseJumpPower"); BaseDamage = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "BaseDamage", 0f, commonName + ": The base damage of your survivor"), "baseDamage"); BaseAttackSpeed = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "BaseAttackSpeed", 0f, commonName + ": The base attack speed of your survivor"), "baseAttackSpeed"); BaseCrit = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "BaseCrit", 0f, commonName + ": The base crit chance of your survivor"), "baseCrit"); BaseArmor = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "BaseArmor", 0f, commonName + ": The base armor of your survivor"), "baseArmor"); BaseJumpCount = new FieldConfigWrapper <int>(survivor.BindConfig( commonName + "BaseJumpCount", 0, commonName + ": The base jump count of your survivor"), "baseJumpCount"); LevelMaxHealth = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "LevelMaxHealth", 0f, commonName + ": The max health per level your survivor gets."), "levelMaxHealth"); LevelRegen = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "LevelRegen", 0f, commonName + ": The regen per level your survivor gets."), "levelRegen"); LevelMaxShield = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "LevelMaxShield", 0f, commonName + ": The max shield per level your survivor gets"), "levelMaxShield"); LevelMoveSpeed = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "LevelMoveSpeed", 0f, commonName + ": The move speed per level your survivor gets"), "levelMoveSpeed"); LevelJumpPower = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "LevelJumpPower", 0f, commonName + ": The jump power per level your survivor gets"), "levelJumpPower"); LevelDamage = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "LevelDamage", 0f, commonName + ": The damage per level your survivor gets"), "levelDamage"); LevelAttackSpeed = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "LevelAttackSpeed", 0f, commonName + ": The attack speed per level your survivor gets"), "levelAttackSpeed"); LevelCrit = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "LevelCrit", 0f, commonName + ": The crit chance per level your survivor gets"), "levelCrit"); LevelArmor = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "LevelArmor", 0f, commonName + ": The armor per level your survivor gets"), "levelArmor"); AllFields = new List <IFieldChanger> { BaseMaxHealth, BaseRegen, BaseMaxShield, BaseMoveSpeed, BaseAcceleration, BaseJumpPower, BaseDamage, BaseAttackSpeed, BaseCrit, BaseArmor, BaseJumpCount, LevelMaxHealth, LevelRegen, LevelMaxShield, LevelMoveSpeed, LevelJumpPower, LevelDamage, LevelAttackSpeed, LevelCrit, LevelArmor }; foreach (var fieldChanger in AllFields) { fieldChanger.AddFieldChangedListener(InternalFieldChanged); } }
public CustomSkillDefinition(CustomSurvivor survivor, int skillIndex, string commonName = null) { SkillIndex = skillIndex; CommonName = commonName; BaseRechargeInterval = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "BaseRechargeInterval", 0f, commonName + ": How long it takes for this skill to recharge after being used."), "baseRechargeInterval"); ShootDelay = new FieldConfigWrapper <float>(survivor.BindConfig( commonName + "ShootDelay", 0f, commonName + ": Time between bullets for bullet-style weapons"), "shootDelay"); BaseMaxStock = new FieldConfigWrapper <int>(survivor.BindConfig( commonName + "BaseMaxStock", 0, commonName + ": Maximum number of charges this skill can carry."), "baseMaxStock"); RechargeStock = new FieldConfigWrapper <int>(survivor.BindConfig( commonName + "RechargeStock", 0, commonName + ": How much stock to restore on a recharge."), "rechargeStock"); IsCombatSkill = new FieldConfigWrapper <bool>(survivor.BindConfig( commonName + "IsCombatSkill", false, commonName + ": Whether or not this is considered a combat skill."), "isCombatSkill"); NoSprint = new FieldConfigWrapper <bool>(survivor.BindConfig( commonName + "NoSprint", false, commonName + ": Whether or not the usage of this skill is mutually exclusive with sprinting."), "noSprint"); RequiredStock = new FieldConfigWrapper <int>(survivor.BindConfig( commonName + "RequiredStock", 0, commonName + ": How much stock is required to activate this skill."), "requiredStock"); StockToConsume = new FieldConfigWrapper <int>(survivor.BindConfig( commonName + "StockToConsume", 0, commonName + ": How much stock to deduct when the skill is activated."), "stockToConsume"); MustKeyPress = new FieldConfigWrapper <bool>(survivor.BindConfig( commonName + "MustKeyPress", false, commonName + ": The skill can't be activated if the key is held."), "mustKeyPress"); BeginSkillCooldownOnSkillEnd = new FieldConfigWrapper <bool>(survivor.BindConfig( commonName + "BeginSkillCooldownOnSkillEnd", false, commonName + ": Whether or not the cooldown waits until it leaves the set state"), "beginSkillCooldownOnSkillEnd"); CanceledFromSprinting = new FieldConfigWrapper <bool>(survivor.BindConfig( commonName + "CanceledFromSprinting", false, commonName + ": Sprinting will actively cancel this ability."), "canceledFromSprinting"); IsBullets = new FieldConfigWrapper <bool>(survivor.BindConfig( commonName + "IsBullets", false, commonName + ": Whether or not it has bullet reload behavior"), "isBullets"); AllFields = new List <IFieldChanger> { BaseRechargeInterval, BaseMaxStock, ShootDelay, RechargeStock, IsCombatSkill, NoSprint, RequiredStock, StockToConsume, MustKeyPress, BeginSkillCooldownOnSkillEnd, CanceledFromSprinting, IsBullets }; foreach (var fieldChanger in AllFields) { fieldChanger.AddFieldChangedListener(InternalFieldChanged); } }