This commit is contained in:
Lucca Faria Ferri 2023-07-24 14:08:16 -07:00
parent 09e0480485
commit dd11da0da5
3 changed files with 23 additions and 15 deletions

View File

@ -47,7 +47,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem
public virtual void Update(int tickCounter) public virtual void Update(int tickCounter)
{ {
if (State == BrainState.Dead || Body == null || Body.World == null || State == BrainState.Off) if (State == BrainState.Dead || Body?.World == null || State == BrainState.Off)
return; return;
Think(tickCounter); // let the brain think. Think(tickCounter); // let the brain think.

View File

@ -383,13 +383,18 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
// Logger.Trace("PowerAction to target"); // Logger.Trace("PowerAction to target");
CurrentAction = new PowerAction(Body, powerToUse, Target); CurrentAction = new PowerAction(Body, powerToUse, Target);
if (power is SummoningSkill) PresetPowers[powerToUse] = power switch
PresetPowers[powerToUse] = new Cooldown {
{ CooldownTimer = null, CooldownTime = (Body is Boss ? 15f : 7f) }; SummoningSkill => new Cooldown
{
if (power is MonsterAffixSkill monsterSkill) CooldownTimer = null, CooldownTime = (Body is Boss ? 15f : 7f)
PresetPowers[powerToUse] = new Cooldown },
{ CooldownTimer = null, CooldownTime = monsterSkill.CooldownTime }; MonsterAffixSkill monsterSkill => new Cooldown
{
CooldownTimer = null, CooldownTime = monsterSkill.CooldownTime
},
_ => PresetPowers[powerToUse]
};
if (PresetPowers[powerToUse].CooldownTime > 0f) if (PresetPowers[powerToUse].CooldownTime > 0f)
PresetPowers[powerToUse] = new Cooldown PresetPowers[powerToUse] = new Cooldown
@ -472,13 +477,15 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
$"{GetType().Name} {nameof(FastAttack)} {nameof(PowerAction)} to target [{Target.ActorType}] {Target.SNO.ToString()}"); $"{GetType().Name} {nameof(FastAttack)} {nameof(PowerAction)} to target [{Target.ActorType}] {Target.SNO.ToString()}");
CurrentAction = new PowerAction(Body, skillSno, target); CurrentAction = new PowerAction(Body, skillSno, target);
if (power is SummoningSkill) PresetPowers[skillSno] = power switch
PresetPowers[skillSno] = new Cooldown {
{ CooldownTimer = null, CooldownTime = (Body is Boss ? 15f : 7f) }; SummoningSkill => new Cooldown { CooldownTimer = null, CooldownTime = (Body is Boss ? 15f : 7f) },
MonsterAffixSkill monsterAffixSkill => new Cooldown
if (power is MonsterAffixSkill monsterAffixSkill) {
PresetPowers[skillSno] = new Cooldown CooldownTimer = null, CooldownTime = monsterAffixSkill.CooldownTime
{ CooldownTimer = null, CooldownTime = monsterAffixSkill.CooldownTime }; },
_ => PresetPowers[skillSno]
};
if (PresetPowers[skillSno].CooldownTime > 0f) if (PresetPowers[skillSno].CooldownTime > 0f)
PresetPowers[skillSno] = new Cooldown PresetPowers[skillSno] = new Cooldown

View File

@ -190,6 +190,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem
int count = player.World.Game.Players.Count; int count = player.World.Game.Players.Count;
if (count > 0 && _adjustedPlayers != count) if (count > 0 && _adjustedPlayers != count)
{ {
// TODO: add modifiers for difficulty settings?
Attributes[GameAttributes.Damage_Weapon_Min, 0] = _nativeDmg * (1f + (0.05f * (count - 1) * player.World.Game.Difficulty)); Attributes[GameAttributes.Damage_Weapon_Min, 0] = _nativeDmg * (1f + (0.05f * (count - 1) * player.World.Game.Difficulty));
Attributes[GameAttributes.Hitpoints_Max] = _nativeHp * (1f + ((0.75f + (0.1f * player.World.Game.Difficulty)) * (count - 1))); Attributes[GameAttributes.Hitpoints_Max] = _nativeHp * (1f + ((0.75f + (0.1f * player.World.Game.Difficulty)) * (count - 1)));
Attributes[GameAttributes.Hitpoints_Cur] = Attributes[GameAttributes.Hitpoints_Max_Total]; Attributes[GameAttributes.Hitpoints_Cur] = Attributes[GameAttributes.Hitpoints_Max_Total];