Browse Source

perf: optimize the bullet system

tags/0.1.0
shangfengh 3 years ago
parent
commit
a340fed2c3
4 changed files with 2 additions and 29 deletions
  1. +1
    -1
      logic/GameClass/GameObj/Bullet/Bullet.cs
  2. +0
    -2
      logic/GameClass/GameObj/Character/Character.Skill.cs
  3. +1
    -1
      logic/Gaming/AttackManager.cs
  4. +0
    -25
      logic/Preparation/Interface/IOccupation.cs

+ 1
- 1
logic/GameClass/GameObj/Bullet/Bullet.cs View File

@@ -110,7 +110,7 @@ namespace GameClass.GameObj
case BulletType.JumpyDumpty:
return JumpyDumpty.maxBulletNum;
default:
return 1;
return 0;
}
}
}


+ 0
- 2
logic/GameClass/GameObj/Character/Character.Skill.cs View File

@@ -91,8 +91,6 @@ namespace GameClass.GameObj
}
this.MaxHp = this.hp = Occupation.MaxHp;
this.OrgMoveSpeed = this.moveSpeed = Occupation.MoveSpeed;
this.OrgCD = this.cd = BulletFactory.BulletCD(Occupation.InitBullet);
this.bulletNum = this.maxBulletNum = Occupation.MaxBulletNum;
this.bulletOfPlayer = this.OriBulletOfPlayer = Occupation.InitBullet;
this.concealment = Occupation.Concealment;
this.alertnessRadius = Occupation.AlertnessRadius;


+ 1
- 1
logic/Gaming/AttackManager.cs View File

@@ -169,7 +169,7 @@ namespace Gaming
return false;
}

if (!player.Commandable())
if (player.BulletOfPlayer == BulletType.Null || !player.Commandable())
return false;

XY res = player.Position + new XY // 子弹紧贴人物生成。


+ 0
- 25
logic/Preparation/Interface/IOccupation.cs View File

@@ -8,7 +8,6 @@ namespace Preparation.Interface
public int MoveSpeed { get; }
public int MaxHp { get; }
public BulletType InitBullet { get; }
public int MaxBulletNum { get; }
public List<ActiveSkillType> ListOfIActiveSkill { get; }
public List<PassiveSkillType> ListOfIPassiveSkill { get; }
public double Concealment { get; }
@@ -38,9 +37,6 @@ namespace Preparation.Interface
private const int maxHp = GameData.basicHp;
public int MaxHp => maxHp;

public const int maxBulletNum = 1;
public int MaxBulletNum => maxBulletNum;

public BulletType InitBullet => BulletType.CommonAttackOfGhost;

public List<ActiveSkillType> ListOfIActiveSkill => new(new ActiveSkillType[] { ActiveSkillType.BecomeInvisible, ActiveSkillType.UseKnife });
@@ -72,9 +68,6 @@ namespace Preparation.Interface
private const int maxHp = GameData.basicHp;
public int MaxHp => maxHp;

public const int maxBulletNum = 1;
public int MaxBulletNum => maxBulletNum;

public BulletType InitBullet => BulletType.CommonAttackOfGhost;

public List<ActiveSkillType> ListOfIActiveSkill => new(new ActiveSkillType[] { ActiveSkillType.JumpyBomb });
@@ -106,9 +99,6 @@ namespace Preparation.Interface
private const int maxHp = GameData.basicHp * 12 / 10;
public int MaxHp => maxHp;

public const int maxBulletNum = 1;
public int MaxBulletNum => maxBulletNum;

public BulletType InitBullet => BulletType.CommonAttackOfGhost;

public List<ActiveSkillType> ListOfIActiveSkill => new(new ActiveSkillType[] { ActiveSkillType.Howl });
@@ -143,9 +133,6 @@ namespace Preparation.Interface
private const int maxGamingAddiction = GameData.basicMaxGamingAddiction * 10;
public int MaxGamingAddiction => maxGamingAddiction;

public const int maxBulletNum = 0;
public int MaxBulletNum => maxBulletNum;

public BulletType InitBullet => BulletType.Null;

public List<ActiveSkillType> ListOfIActiveSkill => new(new ActiveSkillType[] { ActiveSkillType.Punish });
@@ -186,9 +173,6 @@ namespace Preparation.Interface
private const int maxGamingAddiction = GameData.basicMaxGamingAddiction * 9 / 10;
public int MaxGamingAddiction => maxGamingAddiction;

public const int maxBulletNum = 0;
public int MaxBulletNum => maxBulletNum;

public BulletType InitBullet => BulletType.Null;

public List<ActiveSkillType> ListOfIActiveSkill => new(new ActiveSkillType[] { ActiveSkillType.CanBeginToCharge });
@@ -229,9 +213,6 @@ namespace Preparation.Interface
private const int maxGamingAddiction = (int)(GameData.basicMaxGamingAddiction * 1.5);
public int MaxGamingAddiction => maxGamingAddiction;

public const int maxBulletNum = 0;
public int MaxBulletNum => maxBulletNum;

public BulletType InitBullet => BulletType.Null;

public List<ActiveSkillType> ListOfIActiveSkill => new(new ActiveSkillType[] { ActiveSkillType.WriteAnswers });
@@ -272,9 +253,6 @@ namespace Preparation.Interface
private const int maxGamingAddiction = 0;
public int MaxGamingAddiction => maxGamingAddiction;

public const int maxBulletNum = 0;
public int MaxBulletNum => maxBulletNum;

public BulletType InitBullet => BulletType.Null;

public List<ActiveSkillType> ListOfIActiveSkill => new(new ActiveSkillType[] { });
@@ -315,9 +293,6 @@ namespace Preparation.Interface
private const int maxGamingAddiction = (int)(GameData.basicMaxGamingAddiction * 1.1);
public int MaxGamingAddiction => maxGamingAddiction;

public const int maxBulletNum = 0;
public int MaxBulletNum => maxBulletNum;

public BulletType InitBullet => BulletType.Null;

public List<ActiveSkillType> ListOfIActiveSkill => new(new ActiveSkillType[] { });


Loading…
Cancel
Save