Browse Source

refactor: refactor the AP of Bullet

tags/v0.1.0
shangfengh 2 years ago
parent
commit
53c0ddbd45
6 changed files with 63 additions and 44 deletions
  1. +1
    -1
      docs/游戏机制与平衡性调整更新草案.md
  2. +5
    -2
      docs/版本更新说明.md
  3. +44
    -38
      logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs
  4. +11
    -1
      logic/GameClass/GameObj/Bullet/Bullet.cs
  5. +1
    -1
      logic/GameClass/GameObj/Character/Character.cs
  6. +1
    -1
      logic/Preparation/Utility/EnumType.cs

+ 1
- 1
docs/游戏机制与平衡性调整更新草案.md View File

@@ -54,7 +54,7 @@ v1.6
- 视野范围由9000降为8000
- 翻窗速度改为1000
- 特质:
- 扣血则得分50×受到伤害/基本伤害(1500000)
- 扣血则得分100×受到伤害/基本伤害(1500000)
- 技能惩罚(Punish)改为
- CD:45s
- “使用瞬间,在**视野距离/4范围内(不是可视范围)的**翻窗、开锁门、攻击前后摇、**使用技能期间**的捣蛋鬼会被眩晕(3070+**500***已受伤害/基本伤害(1500000))ms”


+ 5
- 2
docs/版本更新说明.md View File

@@ -38,8 +38,11 @@
- feat:Robot可用
- hotfix: 修复了移动相关的bug

# 最新更新
# 5月19日13:00更新
- feat:TechOtaku可用
- feat:Klee、Idol已调整
- fix:修复了InSpire会给Tricker加速的问题
- fix:修复了开锁门的bug
- fix:修复了开锁门的bug

# 最新更新
- docs:更新了 游戏机制与平衡性调整更新草案.pdf

+ 44
- 38
logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs View File

@@ -8,20 +8,48 @@ namespace GameClass.GameObj
public CommonAttackOfGhost(Character player, XY pos, int radius = GameData.bulletRadius) :
base(player, radius, pos)
{
ap = GameData.basicApOfGhost;
}
public override double BulletBombRange => 0;
public override double AttackDistance => GameData.basicAttackShortRange;
public int ap = GameData.basicApOfGhost;
public override int AP
public override int Speed => GameData.basicBulletMoveSpeed;
public override bool IsRemoteAttack => false;

public override int CastTime => (int)AttackDistance * 1000 / Speed;
public override int Backswing => GameData.basicBackswing;
public override int RecoveryFromHit => GameData.basicRecoveryFromHit;
public const int cd = GameData.basicBackswing;
public override int CD => cd;
public const int maxBulletNum = 1;
public override int MaxBulletNum => maxBulletNum;

public override bool CanAttack(GameObj target)
{
get => ap;
set
return false;
}
public override bool CanBeBombed(GameObjType gameObjType)
{
switch (gameObjType)
{
lock (gameObjLock)
ap = value;
case GameObjType.Character:
return true;
default:
return false;
}
}
public override int Speed => GameData.basicBulletMoveSpeed;
public override BulletType TypeOfBullet => BulletType.CommonAttackOfGhost;
}

internal sealed class Strike : Bullet
{
public Strike(Character player, XY pos, int radius = GameData.bulletRadius) :
base(player, radius, pos)
{
ap = GameData.basicApOfGhost * 16 / 15;
}
public override double BulletBombRange => 0;
public override double AttackDistance => GameData.basicAttackShortRange * 20 / 22;
public override int Speed => GameData.basicBulletMoveSpeed * 625 / 740;
public override bool IsRemoteAttack => false;

public override int CastTime => (int)AttackDistance * 1000 / Speed;
@@ -41,12 +69,14 @@ namespace GameClass.GameObj
switch (gameObjType)
{
case GameObjType.Character:
case:
GameObjType.Generator:
return true;
default:
return false;
}
}
public override BulletType TypeOfBullet => BulletType.CommonAttackOfGhost;
public override BulletType TypeOfBullet => BulletType.Strike;
}

internal sealed class FlyingKnife : Bullet
@@ -54,19 +84,11 @@ namespace GameClass.GameObj
public FlyingKnife(Character player, XY pos, int radius = GameData.bulletRadius) :
base(player, radius, pos)
{
ap = GameData.basicApOfGhost * 4 / 5;
}
public override double BulletBombRange => 0;
public override double AttackDistance => GameData.basicRemoteAttackRange * 13;
public int ap = GameData.basicApOfGhost * 4 / 5;
public override int AP
{
get => ap;
set
{
lock (gameObjLock)
ap = value;
}
}

public override int Speed => GameData.basicBulletMoveSpeed * 25 / 10;
public override bool IsRemoteAttack => true;

@@ -102,19 +124,11 @@ namespace GameClass.GameObj
{
public BombBomb(Character player, XY pos, int radius = GameData.bulletRadius) : base(player, radius, pos)
{
ap = (int)(GameData.basicApOfGhost * 6.0 / 5);
}
public override double BulletBombRange => GameData.basicBulletBombRange;
public override double AttackDistance => GameData.basicAttackShortRange;
public int ap = (int)(GameData.basicApOfGhost * 6.0 / 5);
public override int AP
{
get => ap;
set
{
lock (gameObjLock)
ap = value;
}
}

public override int Speed => (int)(GameData.basicBulletMoveSpeed * 30 / 37);
public override bool IsRemoteAttack => false;

@@ -149,19 +163,11 @@ namespace GameClass.GameObj
{
public JumpyDumpty(Character player, XY pos, int radius = GameData.bulletRadius) : base(player, radius, pos)
{
ap = (int)(GameData.basicApOfGhost * 0.6);
}
public override double BulletBombRange => GameData.basicBulletBombRange / 2;
public override double AttackDistance => GameData.basicAttackShortRange * 2;
public int ap = (int)(GameData.basicApOfGhost * 0.6);
public override int AP
{
get => ap;
set
{
lock (gameObjLock)
ap = value;
}
}

public override int Speed => (int)(GameData.basicBulletMoveSpeed * 43 / 37);
public override bool IsRemoteAttack => false;



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

@@ -1,5 +1,6 @@
using Preparation.Interface;
using Preparation.Utility;
using System.Threading;

namespace GameClass.GameObj
{
@@ -10,7 +11,16 @@ namespace GameClass.GameObj
/// </summary>
public abstract double BulletBombRange { get; }
public abstract double AttackDistance { get; }
public abstract int AP { get; set; }
protected int ap;
public int AP
{
get => Interlocked.CompareExchange(ref ap, 0, 1);
}
public void AddAP(int addAp)
{
Interlocked.Add(ref ap, addAp);
}

public abstract int Speed { get; }
public abstract bool IsRemoteAttack { get; }
public abstract int CastTime { get; }


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

@@ -106,7 +106,7 @@ namespace GameClass.GameObj
);
Bullet? bullet = BulletFactory.GetBullet(this, res, this.bulletOfPlayer);
if (bullet == null) return null;
bullet.AP += TryAddAp() ? GameData.ApPropAdd : 0;
if (TryAddAp()) bullet.AddAP(GameData.ApPropAdd);
facingDirection = new(angle, bullet.AttackDistance);
return bullet;
}


+ 1
- 1
logic/Preparation/Utility/EnumType.cs View File

@@ -59,7 +59,7 @@ namespace Preparation.Utility
CommonAttackOfGhost = 2,
JumpyDumpty = 3,
BombBomb = 4,
// Ram = 7,
Strike = 8,
}
public enum PropType // 道具类型
{//numOfPropSpecies 见Gamedata


Loading…
Cancel
Save