Skip to content

Commit

Permalink
Merge pull request eesast#660 from shangfengh/new
Browse files Browse the repository at this point in the history
fix: 🐛 fix the SafeValues
  • Loading branch information
shangfengh authored Jul 9, 2023
2 parents 7eaad7d + 66d2b27 commit 837d736
Show file tree
Hide file tree
Showing 25 changed files with 705 additions and 394 deletions.
2 changes: 1 addition & 1 deletion logic/Client/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ private void Refresh(object? sender, EventArgs e) //log未更新
}
foreach (var obj in listOfButcher)
{
if (!isDataFixed[obj.PlayerId])
if (obj.PlayerId < GameData.numOfStudent && !isDataFixed[obj.PlayerId])
{
IGhostType occupation1 = (IGhostType)OccupationFactory.FindIOccupation(Transformation.ToTrickerType(obj.TrickerType));
int j = 0;
Expand Down
10 changes: 5 additions & 5 deletions logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ internal sealed class CommonAttackOfGhost : Bullet
public CommonAttackOfGhost(Character player, XY pos, int radius = GameData.bulletRadius) :
base(player, radius, pos)
{
AP.Set(GameData.basicApOfGhost);
AP.SetReturnOri(GameData.basicApOfGhost);
}
public override double BulletBombRange => 0;
public override double AttackDistance => GameData.basicAttackShortRange;
Expand Down Expand Up @@ -45,7 +45,7 @@ internal sealed class Strike : Bullet
public Strike(Character player, XY pos, int radius = GameData.bulletRadius) :
base(player, radius, pos)
{
AP.Set(GameData.basicApOfGhost * 16 / 15);
AP.SetReturnOri(GameData.basicApOfGhost * 16 / 15);
}
public override double BulletBombRange => 0;
public override double AttackDistance => GameData.basicAttackShortRange * 20 / 22;
Expand Down Expand Up @@ -83,7 +83,7 @@ internal sealed class FlyingKnife : Bullet
public FlyingKnife(Character player, XY pos, int radius = GameData.bulletRadius) :
base(player, radius, pos)
{
AP.Set(GameData.basicApOfGhost * 4 / 5);
AP.SetReturnOri(GameData.basicApOfGhost * 4 / 5);
}
public override double BulletBombRange => 0;
public override double AttackDistance => GameData.basicRemoteAttackRange * 13;
Expand Down Expand Up @@ -123,7 +123,7 @@ internal sealed class BombBomb : Bullet
{
public BombBomb(Character player, XY pos, int radius = GameData.bulletRadius) : base(player, radius, pos)
{
AP.Set((int)(GameData.basicApOfGhost * 6.0 / 5));
AP.SetReturnOri((int)(GameData.basicApOfGhost * 6.0 / 5));
}
public override double BulletBombRange => GameData.basicBulletBombRange;
public override double AttackDistance => GameData.basicAttackShortRange;
Expand Down Expand Up @@ -163,7 +163,7 @@ internal sealed class JumpyDumpty : Bullet
{
public JumpyDumpty(Character player, XY pos, int radius = GameData.bulletRadius) : base(player, radius, pos)
{
AP.Set((int)(GameData.basicApOfGhost * 0.6));
AP.SetReturnOri((int)(GameData.basicApOfGhost * 0.6));
}
public override double BulletBombRange => GameData.basicBulletBombRange / 2;
public override double AttackDistance => GameData.basicAttackShortRange * 18 / 22;
Expand Down
7 changes: 4 additions & 3 deletions logic/GameClass/GameObj/Bullet/Bullet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public abstract class Bullet : ObjOfCharacter
/// </summary>
public abstract double BulletBombRange { get; }
public abstract double AttackDistance { get; }
public AtomicInt AP { get; }
private AtomicInt ap = new(0);
public AtomicInt AP { get => ap; }
public abstract int Speed { get; }
public abstract bool IsRemoteAttack { get; }
public abstract int CastTime { get; }
Expand Down Expand Up @@ -43,8 +44,8 @@ public override bool IgnoreCollideExecutor(IGameObj targetObj)
public Bullet(Character player, int radius, XY Position) :
base(Position, radius, GameObjType.Bullet)
{
this.CanMove.Set(true);
this.MoveSpeed.Set(this.Speed);
this.CanMove.SetReturnOri(true);
this.MoveSpeed.SetReturnOri(this.Speed);
this.hasSpear = player.TryUseSpear();
this.Parent = player;
}
Expand Down
6 changes: 3 additions & 3 deletions logic/GameClass/GameObj/Character/Character.Skill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public bool IsGhost()
protected Character(XY initPos, int initRadius, CharacterType characterType) :
base(initPos, initRadius, GameObjType.Character)
{
this.CanMove.Set(true);
this.CanMove.SetReturnOri(true);
this.score = 0;
this.buffManager = new BuffManager();
this.occupation = OccupationFactory.FindIOccupation(characterType);
this.MaxHp = this.hp = Occupation.MaxHp;
this.MoveSpeed.Set(this.orgMoveSpeed = Occupation.MoveSpeed);
this.HP = new(Occupation.MaxHp);
this.MoveSpeed.SetReturnOri(this.orgMoveSpeed = Occupation.MoveSpeed);
this.BulletOfPlayer = this.OriBulletOfPlayer = Occupation.InitBullet;
this.concealment = Occupation.Concealment;
this.alertnessRadius = Occupation.AlertnessRadius;
Expand Down
Loading

0 comments on commit 837d736

Please sign in to comment.