Browse Source

fix: 🐛 Try to fix the problem about attacking When clipping

tags/0.1.0
shangfengh 2 years ago
parent
commit
43a71d02aa
5 changed files with 14 additions and 7 deletions
  1. +6
    -3
      docs/QandA.md
  2. +1
    -0
      logic/GameClass/GameObj/Bullet/Bullet.cs
  3. +1
    -1
      logic/GameClass/GameObj/Character/Character.cs
  4. +4
    -2
      logic/Gaming/AttackManager.cs
  5. +2
    -1
      logic/Preparation/Utility/GameData.cs

+ 6
- 3
docs/QandA.md View File

@@ -62,12 +62,15 @@ A:
- 可能措施1.
首先保证Python版本在3.9及以上
- 可能措施2. 更换为国内镜像源
在终端输入
`pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple`
在终端输入 `pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple`
- 可能措施3. 更新pip
`python -m pip install --upgrade pip` (pip 版本最好为23.1)

## 比赛相关
Q:职业数值会修改吗?

A:初赛结束会调数值及机制,增加新角色
A:初赛结束会调数值及机制,增加新角色

Q:初赛后会修改什么呢?

A:技能冷却时间等属性设为不可见;出生点随机性或可选性;增强教师等职业,削弱职业

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

@@ -36,6 +36,7 @@ namespace GameClass.GameObj

public override bool IgnoreCollideExecutor(IGameObj targetObj)
{
if (targetObj == Parent && CanMove) return true;
if (targetObj.Type == GameObjType.Prop || targetObj.Type == GameObjType.Bullet)
return true;
return false;


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

@@ -594,7 +594,7 @@ namespace GameClass.GameObj
{
return true;
}
if (targetObj.Type == GameObjType.Character && XY.DistanceFloor3(targetObj.Position, this.Position) < this.Radius + targetObj.Radius)
if (targetObj.Type == GameObjType.Character && XY.DistanceFloor3(targetObj.Position, this.Position) < this.Radius + targetObj.Radius - GameData.adjustLength)
return true;
return false;
}


+ 4
- 2
logic/Gaming/AttackManager.cs View File

@@ -34,6 +34,7 @@ namespace Gaming
Debugger.Output(obj, " end move at " + obj.Position.ToString() + " At time: " + Environment.TickCount64);
if (obj.CanMove && ((Bullet)obj).TypeOfBullet != BulletType.JumpyDumpty)
BulletBomb((Bullet)obj, null);
obj.CanMove = false;
}
);
this.characterManager = characterManager;
@@ -173,14 +174,15 @@ namespace Gaming

XY res = player.Position + new XY // 子弹紧贴人物生成。
(
(int)((player.Radius + BulletFactory.BulletRadius(player.BulletOfPlayer)) * Math.Cos(angle)),
(int)((player.Radius + BulletFactory.BulletRadius(player.BulletOfPlayer)) * Math.Sin(angle))
(int)(Math.Abs((player.Radius + BulletFactory.BulletRadius(player.BulletOfPlayer)) * Math.Cos(angle))) * ((Math.Cos(angle) > 0) ? 1 : -1),
(int)(Math.Abs((player.Radius + BulletFactory.BulletRadius(player.BulletOfPlayer)) * Math.Sin(angle))) * ((Math.Sin(angle) > 0) ? 1 : -1)
);

Bullet? bullet = player.Attack(res, gameMap.GetPlaceType(res));

if (bullet != null)
{
player.FacingDirection = new(angle, bullet.BulletAttackRange);
Debugger.Output(player, "Attack in " + bullet.ToString());
bullet.AP += player.TryAddAp() ? GameData.ApPropAdd : 0;
bullet.CanMove = true;


+ 2
- 1
logic/Preparation/Utility/GameData.cs View File

@@ -9,7 +9,8 @@ namespace Preparation.Utility
#region 基本常数
public const int numOfStepPerSecond = 20; // 每秒行走的步数

public const int tolerancesLength = 10;
public const int tolerancesLength = 3;
public const int adjustLength = 3;

public const int frameDuration = 50; // 每帧时长
public const int checkInterval = 50; // 检查位置标志、补充子弹的帧时长


Loading…
Cancel
Save