-
Notifications
You must be signed in to change notification settings - Fork 453
Sleep, Innovation, Weakness, and Reflection Summoner Skills #673
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
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @ze-dom, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly overhauls the game's skill and magic effect system, with a particular focus on enhancing the Summoner class. It introduces a more sophisticated framework for defining and applying magic effects, allowing for separate PvP and PvM mechanics, variable durations based on target level, and chances of application. The changes also include new attributes for fine-tuning skill damage, a new 'asleep' status effect, and comprehensive database updates to support these new features. The aim is to provide greater depth and balance to character abilities and combat encounters. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces new Summoner skills (Sleep, Innovation, Weakness) and includes a significant refactoring of the damage calculation system to enhance flexibility, particularly for PvP versus PvE scenarios. The changes are extensive, affecting data models, game logic, and persistence layers. Overall, the implementation is well-structured. I've identified a few issues, including a potential crash due to division by zero, a typo in an attribute description, and a bug in skill effect scaling logic. Addressing these points will improve the robustness and correctness of the new features.
| if (magicEffectDefinition.DurationDependsOnTargetLevel) | ||
| { | ||
| finalDuration -= target is Player | ||
| ? target.Attributes[Stats.Level] / magicEffectDefinition.PlayerTargetLevelDivisor | ||
| : target.Attributes[Stats.Level] / magicEffectDefinition.MonsterTargetLevelDivisor; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a potential DivideByZeroException here if magicEffectDefinition.PlayerTargetLevelDivisor or magicEffectDefinition.MonsterTargetLevelDivisor is set to 0. While the default is 1.0f, it's safer to guard against this case to prevent runtime crashes.
if (magicEffectDefinition.DurationDependsOnTargetLevel)
{
var divisor = target is Player ? magicEffectDefinition.PlayerTargetLevelDivisor : magicEffectDefinition.MonsterTargetLevelDivisor;
if (divisor != 0)
{
finalDuration -= target.Attributes[Stats.Level] / divisor;
}
}| decDmgPowerUpDefinition.Boost.MaximumValue = 0.73f; // based on 4k total energy cap -- to-do: check zTeam | ||
|
|
||
| var decDmgPerEnergy = this.Context.CreateNew<AttributeRelationship>(); | ||
| decDmgPerEnergy.InputAttribute = Stats.Level.GetPersistent(this.GameConfiguration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment on line 110 indicates that the damage decrease scales with energy, but the code uses Stats.Level as the input attribute. This appears to be a copy-paste error and should likely be Stats.TotalEnergy.
decDmgPerEnergy.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration);| decDmgPowerUpDefinitionPvp.Boost.MaximumValue = 1f; // -- to-do: check zTeam | ||
|
|
||
| var decDmgPerEnergyPvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| decDmgPerEnergyPvp.InputAttribute = Stats.Level.GetPersistent(this.GameConfiguration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/GameLogic/Attributes/Stats.cs
Outdated
| /// <summary> | ||
| /// Gets the explosion skill MST bonus damage, which rises with fire tome strengthener and is added late stage. | ||
| /// </summary> | ||
| public static AttributeDefinition ExplosionBonusDmg { get; } = new(new Guid("543E01C2-5C61-4473-ACF9-8A63A987A230"), "Explosion Bonus Damage (MST)", "The explosion skill (book of samut) bonus damage, which rises with fire stome strengthener and is added at a late stage."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo in the description. "stome" should be "tome".
public static AttributeDefinition ExplosionBonusDmg { get; } = new(new Guid("543E01C2-5C61-4473-ACF9-8A63A987A230"), "Explosion Bonus Damage (MST)", "The explosion skill (book of samut) bonus damage, which rises with fire tome strengthener and is added at a late stage.");| if (defense < 0) | ||
| { | ||
| defense = 0; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (magicEffectDefinition.DurationDependsOnTargetLevel) | ||
| { | ||
| var divisor = target is Player ? magicEffectDefinition.PlayerTargetLevelDivisor : magicEffectDefinition.MonsterTargetLevelDivisor; | ||
| if (divisor != 0) | ||
| { | ||
| finalDuration -= target.Attributes[Stats.Level] / divisor; | ||
| } | ||
| } |
| // Defense decrease % (applies last) = 20 + (Energy / 90) | ||
| var decDefPowerUpDefinition = this.Context.CreateNew<PowerUpDefinition>(); | ||
| magicEffect.PowerUpDefinitions.Add(decDefPowerUpDefinition); | ||
| decDefPowerUpDefinition.TargetAttribute = Stats.InnovationDefDecrement.GetPersistent(this.GameConfiguration); | ||
| decDefPowerUpDefinition.Boost = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| decDefPowerUpDefinition.Boost.ConstantValue.Value = 0.20f; // 20% decrease | ||
|
|
||
| var decDefPerEnergy = this.Context.CreateNew<AttributeRelationship>(); | ||
| decDefPerEnergy.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| decDefPerEnergy.InputOperator = InputOperator.Multiply; | ||
| decDefPerEnergy.InputOperand = 1f / 9000f; // 90 energy further decreases 0.01 | ||
| decDefPowerUpDefinition.Boost.RelatedValues.Add(decDefPerEnergy); | ||
|
|
||
| // Defense decrease PvP % (applies last) = 12 + (Energy / 110) | ||
| var decDefPowerUpDefinitionPvp = this.Context.CreateNew<PowerUpDefinition>(); | ||
| magicEffect.PowerUpDefinitionsPvp.Add(decDefPowerUpDefinitionPvp); | ||
| decDefPowerUpDefinitionPvp.TargetAttribute = Stats.InnovationDefDecrement.GetPersistent(this.GameConfiguration); | ||
| decDefPowerUpDefinitionPvp.Boost = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| decDefPowerUpDefinitionPvp.Boost.ConstantValue.Value = 0.12f; // 12% decrease | ||
|
|
||
| var decDefPerEnergyPvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| decDefPerEnergyPvp.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| decDefPerEnergyPvp.InputOperator = InputOperator.Multiply; | ||
| decDefPerEnergyPvp.InputOperand = 1f / 11000f; // 110 energy further decreases 0.01 | ||
| decDefPowerUpDefinitionPvp.Boost.RelatedValues.Add(decDefPerEnergyPvp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zTeamS6.3: ObjAttack.cpp, SkillAdditionInfo.cpp
emu: ObjAttack.cpp, BuffSkillEffect.xml
Maximum values only set on emu.
zTeamS6.3 sets an energy cap at 4000, which means:
Duration PvM = 0.2 + 0.44 => set max value to 0.64?
Duration PvP = 0.12 + 0.36 => set max value to 0.48?
| magicEffect.DurationDependsOnTargetLevel = true; | ||
| magicEffect.MonsterTargetLevelDivisor = 20; | ||
| magicEffect.PlayerTargetLevelDivisor = 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Chance % = 20 + (Energy / 30) + (Book Rise / 6) | ||
| magicEffect.Chance = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.Chance.ConstantValue.Value = 0.2f; // 20% | ||
|
|
||
| var chancePerEnergy = this.Context.CreateNew<AttributeRelationship>(); | ||
| chancePerEnergy.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| chancePerEnergy.InputOperator = InputOperator.Multiply; | ||
| chancePerEnergy.InputOperand = 1f / 3000f; // 30 energy adds 1% chance | ||
| magicEffect.Chance.RelatedValues.Add(chancePerEnergy); | ||
|
|
||
| var chancePerBookRise = this.Context.CreateNew<AttributeRelationship>(); | ||
| chancePerBookRise.InputAttribute = Stats.BookRise.GetPersistent(this.GameConfiguration); | ||
| chancePerBookRise.InputOperator = InputOperator.Multiply; | ||
| chancePerBookRise.InputOperand = 1f / 600f; // 6 book rise adds 1% chance | ||
| magicEffect.Chance.RelatedValues.Add(chancePerBookRise); | ||
|
|
||
| // Chance PvP % = 15 + (Energy / 37) + (Book Rise / 6) | ||
| magicEffect.ChancePvp = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.ChancePvp.ConstantValue.Value = 0.15f; // 15% | ||
|
|
||
| var chancePerEnergyPvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| chancePerEnergyPvp.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| chancePerEnergyPvp.InputOperator = InputOperator.Multiply; | ||
| chancePerEnergyPvp.InputOperand = 1f / 3700f; // 37 energy adds 1% chance | ||
| magicEffect.ChancePvp.RelatedValues.Add(chancePerEnergyPvp); | ||
|
|
||
| var chancePerBookRisePvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| chancePerBookRisePvp.InputAttribute = Stats.BookRise.GetPersistent(this.GameConfiguration); | ||
| chancePerBookRisePvp.InputOperator = InputOperator.Multiply; | ||
| chancePerBookRisePvp.InputOperand = 1f / 600f; // 6 book rise adds 1% chance | ||
| magicEffect.ChancePvp.RelatedValues.Add(chancePerBookRisePvp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zTeamS6.3: ObjAttack.cpp, SkillAdditionInfo.cpp
emu: ObjAttack,
| // Duration = 5 + (Energy / 100) | ||
| magicEffect.Duration = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.Duration.ConstantValue.Value = 5; // 5 Seconds | ||
| magicEffect.Duration.MaximumValue = 20; // 20 Seconds | ||
|
|
||
| var durationPerEnergy = this.Context.CreateNew<AttributeRelationship>(); | ||
| durationPerEnergy.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| durationPerEnergy.InputOperator = InputOperator.Multiply; | ||
| durationPerEnergy.InputOperand = 1f / 100f; // 100 energy adds 1s | ||
| magicEffect.Duration.RelatedValues.Add(durationPerEnergy); | ||
|
|
||
| // Duration = 4 + (Energy / 250) + ((Level - Target's Level) / 100) | ||
| magicEffect.DurationPvp = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.DurationPvp.ConstantValue.Value = 4; // 4 Seconds | ||
| magicEffect.DurationPvp.MaximumValue = 10; // 10 Seconds | ||
|
|
||
| var durationPerEnergyPvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| durationPerEnergyPvp.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| durationPerEnergyPvp.InputOperator = InputOperator.Multiply; | ||
| durationPerEnergyPvp.InputOperand = 1f / 250f; // 250 energy adds 1s | ||
| magicEffect.DurationPvp.RelatedValues.Add(durationPerEnergyPvp); | ||
|
|
||
| var durationPerLevelPvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| durationPerLevelPvp.InputAttribute = Stats.Level.GetPersistent(this.GameConfiguration); | ||
| durationPerLevelPvp.InputOperator = InputOperator.Multiply; | ||
| durationPerLevelPvp.InputOperand = 1f / 100f; // 100 levels adds 1s | ||
| magicEffect.DurationPvp.RelatedValues.Add(durationPerLevelPvp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zTeamS6.3: ObjAttack.cpp, SkillAdditionInfo.cpp
emu: ObjAttack.cpp, BuffSkillEffect.xml
Maximum values only set on emu.
| magicEffect.DurationDependsOnTargetLevel = true; | ||
| magicEffect.MonsterTargetLevelDivisor = 20; | ||
| magicEffect.PlayerTargetLevelDivisor = 150; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Chance % = 32 + (Energy / 50) + (Book Rise / 6) | ||
| magicEffect.Chance = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.Chance.ConstantValue.Value = 0.32f; // 32% | ||
|
|
||
| var chancePerEnergy = this.Context.CreateNew<AttributeRelationship>(); | ||
| chancePerEnergy.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| chancePerEnergy.InputOperator = InputOperator.Multiply; | ||
| chancePerEnergy.InputOperand = 1f / 5000f; // 50 energy adds 1% chance | ||
| magicEffect.Chance.RelatedValues.Add(chancePerEnergy); | ||
|
|
||
| var chancePerBookRise = this.Context.CreateNew<AttributeRelationship>(); | ||
| chancePerBookRise.InputAttribute = Stats.BookRise.GetPersistent(this.GameConfiguration); | ||
| chancePerBookRise.InputOperator = InputOperator.Multiply; | ||
| chancePerBookRise.InputOperand = 1f / 600f; // 6 book rise adds 1% chance | ||
| magicEffect.Chance.RelatedValues.Add(chancePerBookRise); | ||
|
|
||
| // Chance % = 17 + (Energy / 50) + (Book Rise / 6) | ||
| magicEffect.ChancePvp = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.ChancePvp.ConstantValue.Value = 0.17f; // 17% | ||
|
|
||
| var chancePerEnergyPvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| chancePerEnergyPvp.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| chancePerEnergyPvp.InputOperator = InputOperator.Multiply; | ||
| chancePerEnergyPvp.InputOperand = 1f / 5000f; // 50 energy adds 1% chance | ||
| magicEffect.ChancePvp.RelatedValues.Add(chancePerEnergyPvp); | ||
|
|
||
| var chancePerBookRisePvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| chancePerBookRisePvp.InputAttribute = Stats.BookRise.GetPersistent(this.GameConfiguration); | ||
| chancePerBookRisePvp.InputOperator = InputOperator.Multiply; | ||
| chancePerBookRisePvp.InputOperand = 1f / 600f; // 6 book rise adds 1% chance | ||
| magicEffect.ChancePvp.RelatedValues.Add(chancePerBookRisePvp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Duration = 4 + (Energy / 100) | ||
| magicEffect.Duration = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.Duration.ConstantValue.Value = 4; // 4 Seconds | ||
| magicEffect.Duration.MaximumValue = 100; // 100 Seconds | ||
|
|
||
| var durationPerEnergy = this.Context.CreateNew<AttributeRelationship>(); | ||
| durationPerEnergy.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| durationPerEnergy.InputOperator = InputOperator.Multiply; | ||
| durationPerEnergy.InputOperand = 1f / 100f; // 100 energy adds 1s | ||
| magicEffect.Duration.RelatedValues.Add(durationPerEnergy); | ||
|
|
||
| // Duration = 5 + (Energy / 300) + ((Level - Target's Level) / 150) | ||
| magicEffect.DurationPvp = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.DurationPvp.ConstantValue.Value = 5; // 5 Seconds | ||
| magicEffect.DurationPvp.MaximumValue = 20; // 20 Seconds | ||
|
|
||
| var durationPerEnergyPvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| durationPerEnergyPvp.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| durationPerEnergyPvp.InputOperator = InputOperator.Multiply; | ||
| durationPerEnergyPvp.InputOperand = 1f / 300f; // 300 energy adds 1s | ||
| magicEffect.DurationPvp.RelatedValues.Add(durationPerEnergyPvp); | ||
|
|
||
| var durationPerLevelPvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| durationPerLevelPvp.InputAttribute = Stats.Level.GetPersistent(this.GameConfiguration); | ||
| durationPerLevelPvp.InputOperator = InputOperator.Multiply; | ||
| durationPerLevelPvp.InputOperand = 1f / 150f; // 150 levels adds 1s | ||
| magicEffect.DurationPvp.RelatedValues.Add(durationPerLevelPvp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zTeamS6.3: ObjAttack.cpp, SkillAdditionInfo.cpp
emu: ObjAttack.cpp, BuffSkillEffect.xml
Maximum values only set on emu.
Both zTeamS6.3 and emu (only PvM) set an energy cap at 4000, which means:
Duration PvM = 4 + 40 - targetLevel/20 => change max value to 44?
Duration PvP = 5 + 13.3 + (level - targetLevel)/150 => change max value?
| var decDmgPowerUpDefinition = this.Context.CreateNew<PowerUpDefinition>(); | ||
| magicEffect.PowerUpDefinitions.Add(decDmgPowerUpDefinition); | ||
| decDmgPowerUpDefinition.TargetAttribute = Stats.WeaknessPhysDmgDecrement.GetPersistent(this.GameConfiguration); | ||
| decDmgPowerUpDefinition.Boost = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| decDmgPowerUpDefinition.Boost.ConstantValue.Value = 0.04f; // 4% decrease | ||
| decDmgPowerUpDefinition.Boost.MaximumValue = 0.73f; // based on 4k total energy cap -- to-do: check zTeam | ||
|
|
||
| var decDmgPerEnergy = this.Context.CreateNew<AttributeRelationship>(); | ||
| decDmgPerEnergy.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| decDmgPerEnergy.InputOperator = InputOperator.Multiply; | ||
| decDmgPerEnergy.InputOperand = 1f / 5800f; // 58 energy further decreases 0.01 | ||
| decDmgPowerUpDefinition.Boost.RelatedValues.Add(decDmgPerEnergy); | ||
|
|
||
| // Phys damage decrease PvP % = 3 + (Energy / 93) | ||
| var decDmgPowerUpDefinitionPvp = this.Context.CreateNew<PowerUpDefinition>(); | ||
| magicEffect.PowerUpDefinitionsPvp.Add(decDmgPowerUpDefinitionPvp); | ||
| decDmgPowerUpDefinitionPvp.TargetAttribute = Stats.WeaknessPhysDmgDecrement.GetPersistent(this.GameConfiguration); | ||
| decDmgPowerUpDefinitionPvp.Boost = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| decDmgPowerUpDefinitionPvp.Boost.ConstantValue.Value = 0.03f; // 3% decrease | ||
| decDmgPowerUpDefinitionPvp.Boost.MaximumValue = 1f; // -- to-do: check zTeam | ||
|
|
||
| var decDmgPerEnergyPvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| decDmgPerEnergyPvp.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| decDmgPerEnergyPvp.InputOperator = InputOperator.Multiply; | ||
| decDmgPerEnergyPvp.InputOperand = 1f / 9300f; // 93 energy further decreases 0.01 | ||
| decDmgPowerUpDefinitionPvp.Boost.RelatedValues.Add(decDmgPerEnergyPvp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zTeamS6.3: ObjAttack.cpp, SkillAdditionInfo.cpp
emu: ObjAttack.cpp, BuffSkillEffect.xml
Maximum values set on emu and zTeamS6.3 (only PvP).
Both zTeamS6.3 and emu (only PvM) set an energy cap at 4000, which means:
Decrease PvM = 0.04 + 0.69 => set max value to 0.73?
Decrease PvP = 0.03 + 0.43 => set max value to 0.46?
| // Chance to apply the effect | ||
| magicEffect.Chance = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.Chance.ConstantValue.Value = 0.1f; // 10% | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Duration = 30 + (Energy / 24) | ||
| magicEffect.Duration = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.Duration.ConstantValue.Value = 30; // 30 Seconds | ||
| magicEffect.Duration.MaximumValue = 180; | ||
|
|
||
| var durationPerEnergy = this.Context.CreateNew<AttributeRelationship>(); | ||
| durationPerEnergy.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| durationPerEnergy.InputOperator = InputOperator.Multiply; | ||
| durationPerEnergy.InputOperand = 1f / 24; // 24 energy adds 1s | ||
| magicEffect.Duration.RelatedValues.Add(durationPerEnergy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zTeamS6.3: ObjUseSkill.cpp, SkillAdditionInfo.cpp (no data)
emu: ObjUseSkill.cpp, BuffSkillEffect.xml
| // Reflection % = 30 + (Energy / 42) | ||
| var incReflectPowerUpDefinition = this.Context.CreateNew<PowerUpDefinition>(); | ||
| magicEffect.PowerUpDefinitions.Add(incReflectPowerUpDefinition); | ||
| incReflectPowerUpDefinition.TargetAttribute = Stats.DamageReflection.GetPersistent(this.GameConfiguration); | ||
| incReflectPowerUpDefinition.Boost = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| incReflectPowerUpDefinition.Boost.ConstantValue.Value = 0.3f; // 30% increase | ||
| incReflectPowerUpDefinition.Boost.MaximumValue = 0.6f; | ||
|
|
||
| var incReflectPerEnergy = this.Context.CreateNew<AttributeRelationship>(); | ||
| incReflectPerEnergy.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| incReflectPerEnergy.InputOperator = InputOperator.Multiply; | ||
| incReflectPerEnergy.InputOperand = 1f / 4200f; // 42 energy further increases 0.01 | ||
| incReflectPowerUpDefinition.Boost.RelatedValues.Add(incReflectPerEnergy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zTeamS6.3: ObjUseSkill.cpp, SkillAdditionInfo.cpp (no data)
emu: ObjUseSkill.cpp, BuffSkillEffect.xml
Maximum value only set on emu.
| this.CreateSkill(SkillNumber.Weakness, "Weakness", CharacterClasses.AllSummoners, distance: 6, abilityConsumption: 15, manaConsumption: 50, energyRequirement: 663, skillType: SkillType.Buff); | ||
| this.AddAreaSkillSettings(SkillNumber.Weakness, false, 0, 0, 0, maximumHitsPerAttack: 5, useTargetAreaFilter: true, targetAreaDiameter: 10); | ||
| this.CreateSkill(SkillNumber.Innovation, "Innovation", CharacterClasses.AllSummoners, distance: 6, abilityConsumption: 15, manaConsumption: 70, energyRequirement: 912, skillType: SkillType.Buff); | ||
| this.AddAreaSkillSettings(SkillNumber.Innovation, false, 0, 0, 0, maximumHitsPerAttack: 5, useTargetAreaFilter: true, targetAreaDiameter: 10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| this.CreateSkill(SkillNumber.Innovation, "Innovation", CharacterClasses.AllSummoners, distance: 6, abilityConsumption: 15, manaConsumption: 70, energyRequirement: 912); | ||
| this.CreateSkill(SkillNumber.Sleep, "Sleep", CharacterClasses.AllSummoners, distance: 6, abilityConsumption: 3, manaConsumption: 20, energyRequirement: 180, skillType: SkillType.Buff); | ||
| this.CreateSkill(SkillNumber.Weakness, "Weakness", CharacterClasses.AllSummoners, distance: 6, abilityConsumption: 15, manaConsumption: 50, energyRequirement: 663, skillType: SkillType.Buff); | ||
| this.AddAreaSkillSettings(SkillNumber.Weakness, false, 0, 0, 0, maximumHitsPerAttack: 5, useTargetAreaFilter: true, targetAreaDiameter: 10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| default: | ||
| // no change needed | ||
| break; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a switch-case because there will be another case for a RF skill in future PR 😉
| // Duration = 4 + (Energy / 100) | ||
| magicEffect.Duration = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.Duration.ConstantValue.Value = 4; // 4 Seconds | ||
| magicEffect.Duration.MaximumValue = 44; // 44 Seconds (based on 4k total energy cap) | ||
|
|
||
| var durationPerEnergy = this.Context.CreateNew<AttributeRelationship>(); | ||
| durationPerEnergy.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| durationPerEnergy.InputOperator = InputOperator.Multiply; | ||
| durationPerEnergy.InputOperand = 1f / 100f; // 100 energy adds 1s | ||
| magicEffect.Duration.RelatedValues.Add(durationPerEnergy); | ||
|
|
||
| // Duration PvP = 5 + (Energy / 300) + ((Level - Target's Level) / 150) | ||
| magicEffect.DurationPvp = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.DurationPvp.ConstantValue.Value = 5; // 5 Seconds | ||
| magicEffect.DurationPvp.MaximumValue = 18; // 18 Seconds (based on 4k total energy cap) | ||
|
|
||
| var durationPerEnergyPvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| durationPerEnergyPvp.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| durationPerEnergyPvp.InputOperator = InputOperator.Multiply; | ||
| durationPerEnergyPvp.InputOperand = 1f / 300f; // 300 energy adds 1s | ||
| magicEffect.DurationPvp.RelatedValues.Add(durationPerEnergyPvp); | ||
|
|
||
| var durationPerLevelPvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| durationPerLevelPvp.InputAttribute = Stats.Level.GetPersistent(this.GameConfiguration); | ||
| durationPerLevelPvp.InputOperator = InputOperator.Multiply; | ||
| durationPerLevelPvp.InputOperand = 1f / 150f; // 150 levels adds 1s | ||
| magicEffect.DurationPvp.RelatedValues.Add(durationPerLevelPvp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zTeamS6.3: ObjAttack.cpp, SkillAdditionInfo.cpp
emu: ObjAttack.cpp, BuffSkillEffect.xml
Maximum values only set on emu.
zTeamS6.3 sets an energy cap at 4000, which means:
Duration PvM = 4 + 40 - targetLevel/20 => max value = 44
Duration PvP = 5 + 13.3 + (level - targetLevel)/150 => max value = 18
| // Defense decrease % (applies last) = 20 + (Energy / 90) | ||
| var decDefPowerUpDefinition = this.Context.CreateNew<PowerUpDefinition>(); | ||
| magicEffect.PowerUpDefinitions.Add(decDefPowerUpDefinition); | ||
| decDefPowerUpDefinition.TargetAttribute = Stats.InnovationDefDecrement.GetPersistent(this.GameConfiguration); | ||
| decDefPowerUpDefinition.Boost = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| decDefPowerUpDefinition.Boost.ConstantValue.Value = 0.20f; // 20% decrease | ||
| decDefPowerUpDefinition.Boost.MaximumValue = 0.64f; // 64% decrease (based on 4k total energy cap) | ||
|
|
||
| var decDefPerEnergy = this.Context.CreateNew<AttributeRelationship>(); | ||
| decDefPerEnergy.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| decDefPerEnergy.InputOperator = InputOperator.Multiply; | ||
| decDefPerEnergy.InputOperand = 1f / 9000f; // 90 energy further decreases 0.01 | ||
| decDefPowerUpDefinition.Boost.RelatedValues.Add(decDefPerEnergy); | ||
|
|
||
| // Defense decrease PvP % (applies last) = 12 + (Energy / 110) | ||
| var decDefPowerUpDefinitionPvp = this.Context.CreateNew<PowerUpDefinition>(); | ||
| magicEffect.PowerUpDefinitionsPvp.Add(decDefPowerUpDefinitionPvp); | ||
| decDefPowerUpDefinitionPvp.TargetAttribute = Stats.InnovationDefDecrement.GetPersistent(this.GameConfiguration); | ||
| decDefPowerUpDefinitionPvp.Boost = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| decDefPowerUpDefinitionPvp.Boost.ConstantValue.Value = 0.12f; // 12% decrease | ||
| decDefPowerUpDefinitionPvp.Boost.MaximumValue = 0.48f; // 48% decrease (based on 4k total energy cap) | ||
|
|
||
| var decDefPerEnergyPvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| decDefPerEnergyPvp.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| decDefPerEnergyPvp.InputOperator = InputOperator.Multiply; | ||
| decDefPerEnergyPvp.InputOperand = 1f / 11000f; // 110 energy further decreases 0.01 | ||
| decDefPowerUpDefinitionPvp.Boost.RelatedValues.Add(decDefPerEnergyPvp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zTeamS6.3: ObjAttack.cpp, SkillAdditionInfo.cpp
emu: ObjAttack.cpp, BuffSkillEffect.xml
Maximum values only set on emu.
zTeamS6.3 sets an energy cap at 4000, which means:
Duration PvM = 0.2 + 0.44 => max value = 0.64
Duration PvP = 0.12 + 0.36 => max value = 0.48
| // Duration = 4 + (Energy / 100) | ||
| magicEffect.Duration = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.Duration.ConstantValue.Value = 4; // 4 Seconds | ||
| magicEffect.Duration.MaximumValue = 44; // 44 Seconds (based on 4k total energy cap) | ||
|
|
||
| var durationPerEnergy = this.Context.CreateNew<AttributeRelationship>(); | ||
| durationPerEnergy.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| durationPerEnergy.InputOperator = InputOperator.Multiply; | ||
| durationPerEnergy.InputOperand = 1f / 100f; // 100 energy adds 1s | ||
| magicEffect.Duration.RelatedValues.Add(durationPerEnergy); | ||
|
|
||
| // Duration = 5 + (Energy / 300) + ((Level - Target's Level) / 150) | ||
| magicEffect.DurationPvp = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.DurationPvp.ConstantValue.Value = 5; // 5 Seconds | ||
| magicEffect.DurationPvp.MaximumValue = 18; // 18 Seconds (based on 4k total energy cap) | ||
|
|
||
| var durationPerEnergyPvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| durationPerEnergyPvp.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| durationPerEnergyPvp.InputOperator = InputOperator.Multiply; | ||
| durationPerEnergyPvp.InputOperand = 1f / 300f; // 300 energy adds 1s | ||
| magicEffect.DurationPvp.RelatedValues.Add(durationPerEnergyPvp); | ||
|
|
||
| var durationPerLevelPvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| durationPerLevelPvp.InputAttribute = Stats.Level.GetPersistent(this.GameConfiguration); | ||
| durationPerLevelPvp.InputOperator = InputOperator.Multiply; | ||
| durationPerLevelPvp.InputOperand = 1f / 150f; // 150 levels adds 1s | ||
| magicEffect.DurationPvp.RelatedValues.Add(durationPerLevelPvp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zTeamS6.3: ObjAttack.cpp, SkillAdditionInfo.cpp
emu: ObjAttack.cpp, BuffSkillEffect.xml
Maximum values only set on emu.
Both zTeamS6.3 and emu (only PvM) set an energy cap at 4000, which means:
Duration PvM = 4 + 40 - targetLevel/20 => max value = 44
Duration PvP = 5 + 13.3 + (level - targetLevel)/150 => max value = 18
| var decDmgPowerUpDefinition = this.Context.CreateNew<PowerUpDefinition>(); | ||
| magicEffect.PowerUpDefinitions.Add(decDmgPowerUpDefinition); | ||
| decDmgPowerUpDefinition.TargetAttribute = Stats.WeaknessPhysDmgDecrement.GetPersistent(this.GameConfiguration); | ||
| decDmgPowerUpDefinition.Boost = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| decDmgPowerUpDefinition.Boost.ConstantValue.Value = 0.04f; // 4% decrease | ||
| decDmgPowerUpDefinition.Boost.MaximumValue = 0.73f; // 73% decrease (based on 4k total energy cap) | ||
|
|
||
| var decDmgPerEnergy = this.Context.CreateNew<AttributeRelationship>(); | ||
| decDmgPerEnergy.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| decDmgPerEnergy.InputOperator = InputOperator.Multiply; | ||
| decDmgPerEnergy.InputOperand = 1f / 5800f; // 58 energy further decreases 0.01 | ||
| decDmgPowerUpDefinition.Boost.RelatedValues.Add(decDmgPerEnergy); | ||
|
|
||
| // Phys damage decrease PvP % = 3 + (Energy / 93) | ||
| var decDmgPowerUpDefinitionPvp = this.Context.CreateNew<PowerUpDefinition>(); | ||
| magicEffect.PowerUpDefinitionsPvp.Add(decDmgPowerUpDefinitionPvp); | ||
| decDmgPowerUpDefinitionPvp.TargetAttribute = Stats.WeaknessPhysDmgDecrement.GetPersistent(this.GameConfiguration); | ||
| decDmgPowerUpDefinitionPvp.Boost = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| decDmgPowerUpDefinitionPvp.Boost.ConstantValue.Value = 0.03f; // 3% decrease | ||
| decDmgPowerUpDefinitionPvp.Boost.MaximumValue = 0.46f; // 46% decrease (based on 4k total energy cap) | ||
|
|
||
| var decDmgPerEnergyPvp = this.Context.CreateNew<AttributeRelationship>(); | ||
| decDmgPerEnergyPvp.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
| decDmgPerEnergyPvp.InputOperator = InputOperator.Multiply; | ||
| decDmgPerEnergyPvp.InputOperand = 1f / 9300f; // 93 energy further decreases 0.01 | ||
| decDmgPowerUpDefinitionPvp.Boost.RelatedValues.Add(decDmgPerEnergyPvp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zTeamS6.3: ObjAttack.cpp, SkillAdditionInfo.cpp
emu: ObjAttack.cpp, BuffSkillEffect.xml
Maximum values set on emu and zTeamS6.3 (only PvP).
Both zTeamS6.3 and emu (only PvM) set an energy cap at 4000, which means:
Decrease PvM = 0.04 + 0.69 => max value = 0.73
Decrease PvP = 0.03 + 0.43 => max value = 0.46
src/GameLogic/Player.cs
Outdated
| var fullReflectPercentage = this.Attributes[Stats.FullyReflectDamageAfterHitChance]; | ||
| if (fullReflectPercentage > 0 && Rand.NextRandomBool(fullReflectPercentage)) | ||
| { | ||
| var reflectedDamage = attackableAttacker is Player | ||
| ? (hitInfo.HealthDamage + hitInfo.ShieldDamage) | ||
| : attackableAttacker.Attributes[Stats.MaximumPhysBaseDmg]; | ||
| ReflectDamage(reflectedDamage, attackableAttacker); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ? (hitInfo.HealthDamage + hitInfo.ShieldDamage) | ||
| : attackableAttacker.Attributes[Stats.MaximumPhysBaseDmg]; | ||
| ReflectDamage(reflectedDamage, attackableAttacker); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| _ = Task.Run(async () => | ||
| { | ||
| await Task.Delay(500).ConfigureAwait(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for reference, the sources delay seems to be 10ms (links above)
| { | ||
| return false; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not aware of any effect that can be applied when the target is dead. This saves some unnecessary computations 😛
🚧 WIP 🚧
This is a follow-up on PR#477 from @bernatvadell . Used it as the basis.
To-do: