Browse Source

feat: 🎨 Write a Map,and so on

tags/0.1.0
shangfengh 2 years ago
parent
commit
d55bef7688
16 changed files with 193 additions and 174 deletions
  1. +1
    -1
      logic/GameClass/GameObj/Bullet/Bullet.cs
  2. +13
    -2
      logic/GameClass/GameObj/Character/Character.Ghost.cs
  3. +13
    -25
      logic/GameClass/GameObj/Character/Character.SkillManager.cs
  4. +15
    -3
      logic/GameClass/GameObj/Character/Character.Student.cs
  5. +4
    -10
      logic/GameClass/GameObj/Character/Character.cs
  6. +0
    -28
      logic/GameClass/GameObj/Map/BirthPoint.cs
  7. +4
    -14
      logic/GameClass/GameObj/Map/Map.cs
  8. +50
    -50
      logic/GameClass/GameObj/Map/MapInfo.cs
  9. +1
    -1
      logic/GameClass/GameObj/Prop.cs
  10. +23
    -0
      logic/GameClass/Skill/ActiveSkill.cs
  11. +29
    -1
      logic/GameClass/Skill/Occupation.cs
  12. +3
    -3
      logic/GameEngine/MoveEngine.cs
  13. +7
    -6
      logic/Gaming/AttackManager.cs
  14. +3
    -4
      logic/Gaming/Game.cs
  15. +10
    -13
      logic/Preparation/Utility/EnumType.cs
  16. +17
    -13
      logic/Preparation/Utility/GameData.cs

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

@@ -33,7 +33,7 @@ namespace GameClass.GameObj

protected override bool IgnoreCollideExecutor(IGameObj targetObj)
{
if (targetObj.Type == GameObjType.BirthPoint || targetObj.Type == GameObjType.Prop || targetObj.Type == GameObjType.Bullet)
if (targetObj.Type == GameObjType.Prop || targetObj.Type == GameObjType.Bullet)
return true;
return false;
}


+ 13
- 2
logic/GameClass/GameObj/Character/Character.Ghost.cs View File

@@ -1,4 +1,5 @@
using Preparation.Interface;
using GameClass.Skill;
using Preparation.Interface;
using Preparation.Utility;
using System;
using System.Collections.Generic;
@@ -10,8 +11,18 @@ namespace GameClass.GameObj
{
public class Ghost : Character
{
public Ghost(XY initPos, int initRadius, PlaceType initPlace, CharacterType characterType) : base(initPos, initRadius, initPlace, characterType)
public Ghost(XY initPos, int initRadius, PlaceType initPlace, CharacterType characterType) : base(initPos, initRadius, initPlace)
{
switch (characterType)
{
case CharacterType.Assassin:
this.Occupation = new Assassin();
break;
default:
this.Occupation = null;
break;
}
this.CharacterType = characterType;
}
}
}

+ 13
- 25
logic/GameClass/GameObj/Character/Character.SkillManager.cs View File

@@ -7,11 +7,8 @@ namespace GameClass.GameObj
{
public partial class Character
{

private readonly CharacterType characterType;
public CharacterType CharacterType => characterType;
private readonly IOccupation occupation;
public IOccupation Occupation => occupation;
public CharacterType CharacterType { protected set; get; }
public IOccupation Occupation { protected set; get; }

private Dictionary<ActiveSkillType, int> timeUntilActiveSkillAvailable;
public Dictionary<ActiveSkillType, int> TimeUntilActiveSkillAvailable => timeUntilActiveSkillAvailable;
@@ -53,39 +50,30 @@ namespace GameClass.GameObj

public bool IsGhost()
{
return this.characterType switch
return this.CharacterType switch
{
CharacterType.Assassin => true,
_ => false,
};
}

public Character(XY initPos, int initRadius, PlaceType initPlace, CharacterType characterType) :
protected Character(XY initPos, int initRadius, PlaceType initPlace) :
base(initPos, initRadius, initPlace, GameObjType.Character)
{
this.CanMove = true;
this.score = 0;
this.propInventory = null;
this.buffManager = new BuffManager();
switch (characterType)
{
case CharacterType.Assassin:
this.occupation = new Assassin();
break;
default:
this.occupation = null;
break;
}
this.MaxHp = occupation.MaxHp;
this.hp = occupation.MaxHp;
this.OrgMoveSpeed = occupation.MoveSpeed;
this.moveSpeed = occupation.MoveSpeed;
this.cd = occupation.CD;
this.maxBulletNum = occupation.MaxBulletNum;

this.MaxHp = Occupation.MaxHp;
this.hp = Occupation.MaxHp;
this.OrgMoveSpeed = Occupation.MoveSpeed;
this.moveSpeed = Occupation.MoveSpeed;
this.cd = Occupation.CD;
this.maxBulletNum = Occupation.MaxBulletNum;
this.bulletNum = maxBulletNum;
this.bulletOfPlayer = occupation.InitBullet;
this.OriBulletOfPlayer = occupation.InitBullet;
this.characterType = characterType;
this.bulletOfPlayer = Occupation.InitBullet;
this.OriBulletOfPlayer = Occupation.InitBullet;

foreach (var activeSkill in this.Occupation.ListOfIActiveSkill)
{


+ 15
- 3
logic/GameClass/GameObj/Character/Character.Student.cs View File

@@ -1,10 +1,11 @@
using Preparation.Utility;
using GameClass.Skill;
using Preparation.Utility;

namespace GameClass.GameObj
{
public class Student : Character
{
protected int fixSpeed = GameData.basicFixSpeed;
protected int fixSpeed;
/// <summary>
/// 修理电机速度
/// </summary>
@@ -100,8 +101,19 @@ namespace GameClass.GameObj
IsResetting = true;
PlayerState = PlayerStateType.IsEscaped;
}
public Student(XY initPos, int initRadius, PlaceType initPlace, CharacterType characterType) : base(initPos, initRadius, initPlace, characterType)
public Student(XY initPos, int initRadius, PlaceType initPlace, CharacterType characterType) : base(initPos, initRadius, initPlace)
{
switch (characterType)
{
case CharacterType.Athlete:
this.Occupation = new Athlete();
break;
default:
this.Occupation = null;
break;
}
this.fixSpeed = ((IStudent)Occupation).FixSpeed;
this.CharacterType = characterType;
}
}
}

+ 4
- 10
logic/GameClass/GameObj/Character/Character.cs View File

@@ -65,8 +65,9 @@ namespace GameClass.GameObj
}
set
{
lock (gameObjLock)
CanMove = (value == PlayerStateType.IsMoving || value == PlayerStateType.Null);
if (!(value == PlayerStateType.IsMoving || value == PlayerStateType.Null))
lock (gameObjLock)
IsMoving = false;

lock (gameObjLock) playerState = (value == PlayerStateType.IsMoving) ? PlayerStateType.Null : value;
}
@@ -474,14 +475,7 @@ namespace GameClass.GameObj
public override ShapeType Shape => ShapeType.Circle;
protected override bool IgnoreCollideExecutor(IGameObj targetObj)
{
if (targetObj.Type == GameObjType.BirthPoint)
{
if (object.ReferenceEquals(((BirthPoint)targetObj).Parent, this)) // 自己的出生点可以忽略碰撞
{
return true;
}
}
else if (targetObj.Type == GameObjType.Prop) // 自己队的地雷忽略碰撞
if (targetObj.Type == GameObjType.Prop) // 自己队的地雷忽略碰撞
{
return true;
}


+ 0
- 28
logic/GameClass/GameObj/Map/BirthPoint.cs View File

@@ -1,28 +0,0 @@
using Preparation.Interface;
using Preparation.Utility;

namespace GameClass.GameObj
{
/// <summary>
/// 出生点
/// </summary>
public class BirthPoint : ObjOfCharacter
{
public BirthPoint(XY initPos) :
base(initPos, GameData.numOfPosGridPerCell / 2, PlaceType.Land, GameObjType.BirthPoint)
{
this.CanMove = false;
}
// 修改建议:需要避免非自己的玩家进入出生点,否则会重叠
public override bool IsRigid => true;
protected override bool IgnoreCollideExecutor(IGameObj targetObj)
{
if (targetObj.Type != GameObjType.Character)
return true; // 非玩家不碰撞
else if (targetObj.Type == GameObjType.Character && targetObj.ID == this.Parent.ID)
return true; // 出生点所属的玩家不碰撞
return false;
}
public override ShapeType Shape => ShapeType.Square;
}
}

+ 4
- 14
logic/GameClass/GameObj/Map/Map.cs View File

@@ -9,8 +9,8 @@ namespace GameClass.GameObj
public partial class Map : IMap
{

private readonly Dictionary<uint, BirthPoint> birthPointList; // 出生点列表
public Dictionary<uint, BirthPoint> BirthPointList => birthPointList;
private readonly Dictionary<uint, XY> birthPointList; // 出生点列表
public Dictionary<uint, XY> BirthPointList => birthPointList;

private Dictionary<GameObjType, IList<IGameObj>> gameObjDict;
public Dictionary<GameObjType, IList<IGameObj>> GameObjDict => gameObjDict;
@@ -106,7 +106,7 @@ namespace GameClass.GameObj
ProtoGameMap = new uint[mapResource.GetLength(0), mapResource.GetLength(1)];
Array.Copy(mapResource, ProtoGameMap, mapResource.Length);

birthPointList = new Dictionary<uint, BirthPoint>(GameData.numOfBirthPoint);
birthPointList = new Dictionary<uint, XY>(GameData.numOfBirthPoint);

for (int i = 0; i < GameData.rows; ++i)
{
@@ -173,17 +173,7 @@ namespace GameClass.GameObj
case (uint)MapInfoObjType.BirthPoint4:
case (uint)MapInfoObjType.BirthPoint5:
{
BirthPoint newBirthPoint = new BirthPoint(GameData.GetCellCenterPos(i, j));
birthPointList.Add(mapResource[i, j], newBirthPoint);
GameObjLockDict[GameObjType.BirthPoint].EnterWriteLock();
try
{
GameObjDict[GameObjType.BirthPoint].Add(newBirthPoint);
}
finally
{
GameObjLockDict[GameObjType.BirthPoint].ExitWriteLock();
}
birthPointList.Add(mapResource[i, j], GameData.GetCellCenterPos(i, j));
break;
}
}


+ 50
- 50
logic/GameClass/GameObj/Map/MapInfo.cs View File

@@ -12,56 +12,56 @@ namespace GameClass.GameObj
/// 50*50
/// </summary>
public static uint[,] defaultMap = new uint[,] {
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
{ 1, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
{ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }
};
}
}

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

@@ -12,7 +12,7 @@ namespace GameClass.GameObj

protected override bool IgnoreCollideExecutor(IGameObj targetObj)
{
if (targetObj.Type == GameObjType.BirthPoint || targetObj.Type == GameObjType.Prop || targetObj.Type == GameObjType.Bullet || targetObj.Type == GameObjType.Character)
if (targetObj.Type == GameObjType.Prop || targetObj.Type == GameObjType.Bullet || targetObj.Type == GameObjType.Character)
return true;
return false;
}


+ 23
- 0
logic/GameClass/Skill/ActiveSkill.cs View File

@@ -29,6 +29,29 @@ namespace GameClass.Skill
});
}
}

public class BeginToCharge : IActiveSkill
{
public int SkillCD => GameData.commonSkillCD / 3 * 4;
public int DurationTime => GameData.commonSkillTime;

private readonly object commonSkillLock = new object();
public object ActiveSkillLock => commonSkillLock;

public bool SkillEffect(Character player)
{
return ActiveSkillFactory.SkillEffect(this, player, () =>
{
player.Vampire += 0.5;
Debugger.Output(player, "becomes vampire!");
},
() =>
{
double tempVam = player.Vampire - 0.5;
player.Vampire = tempVam < player.OriVampire ? player.OriVampire : tempVam;
});
}
}
public class BecomeInvisible : IActiveSkill
{
public int SkillCD => GameData.commonSkillCD;


+ 29
- 1
logic/GameClass/Skill/Occupation.cs View File

@@ -14,7 +14,17 @@ namespace GameClass.Skill
public List<IActiveSkill> ListOfIActiveSkill { get; }
public List<IPassiveSkill> ListOfIPassiveSkill { get; }
}
public class Assassin : IOccupation

public interface IGhost : IOccupation
{
}

public interface IStudent : IOccupation
{
public int FixSpeed { get; }
}

public class Assassin : IGhost
{
private const int moveSpeed = GameData.basicMoveSpeed / 380 * 473;
public int MoveSpeed => moveSpeed;
@@ -33,5 +43,23 @@ namespace GameClass.Skill
public List<IActiveSkill> ListOfIActiveSkill => new(new IActiveSkill[] { new BecomeInvisible(), new UseKnife() });
public List<IPassiveSkill> ListOfIPassiveSkill => new(new IPassiveSkill[] { });
}
public class Athlete : IOccupation
{
private const int moveSpeed = GameData.basicMoveSpeed;
public int MoveSpeed => moveSpeed;

private const int maxHp = GameData.basicHp;
public int MaxHp => maxHp;

public const int cd = 0;
public int CD => cd;

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

public BulletType InitBullet => BulletType.CommonAttackOfGhost;

public List<IActiveSkill> ListOfIActiveSkill => new(new IActiveSkill[] { new BecomeInvisible(), new UseKnife() });
public List<IPassiveSkill> ListOfIPassiveSkill => new(new IPassiveSkill[] { });
}
}

+ 3
- 3
logic/GameEngine/MoveEngine.cs View File

@@ -63,7 +63,7 @@ namespace GameEngine
(
() =>
{
if (!obj.IsAvailable && gameTimer.IsGaming) //不能动就直接return,后面都是能动的情况
if (!obj.IsAvailable && gameTimer.IsGaming)
return;
lock (obj.MoveLock)
obj.IsMoving = true;
@@ -73,7 +73,7 @@ namespace GameEngine
IGameObj? collisionObj = null;
bool isDestroyed = false;
new FrameRateTaskExecutor<int>(
() => gameTimer.IsGaming && obj.CanMove && !obj.IsResetting,
() => gameTimer.IsGaming && obj.CanMove && !obj.IsResetting && obj.IsMoving,
() =>
{
moveVecLength = obj.MoveSpeed / GameData.numOfStepPerSecond;
@@ -141,7 +141,7 @@ namespace GameEngine
}
}
} while (flag);
if (leftTime > 0)
if (leftTime > 0 && obj.IsMoving)
{
Thread.Sleep(leftTime); // 多移动的在这里补回来
}


+ 7
- 6
logic/Gaming/AttackManager.cs View File

@@ -6,6 +6,7 @@ using Preparation.Utility;
using GameEngine;
using Preparation.Interface;
using Timothy.FrameRateTask;
using System.Numerics;

namespace Gaming
{
@@ -192,7 +193,7 @@ namespace Gaming
{
Thread.Sleep(bullet.Backswing);

if (gameMap.Timer.IsGaming)
if (gameMap.Timer.IsGaming && bullet.Parent.PlayerState == PlayerStateType.IsSwinging)
{
bullet.Parent.PlayerState = PlayerStateType.Null;
}
@@ -215,7 +216,7 @@ namespace Gaming

Thread.Sleep(bullet.RecoveryFromHit);

if (gameMap.Timer.IsGaming)
if (gameMap.Timer.IsGaming && bullet.Parent.PlayerState == PlayerStateType.IsSwinging)
{
bullet.Parent.PlayerState = PlayerStateType.Null;
}
@@ -273,7 +274,7 @@ namespace Gaming
{
Thread.Sleep(bullet.Backswing);

if (gameMap.Timer.IsGaming)
if (gameMap.Timer.IsGaming && bullet.Parent.PlayerState == PlayerStateType.IsSwinging)
{
bullet.Parent.PlayerState = PlayerStateType.Null;
}
@@ -294,7 +295,7 @@ namespace Gaming

Thread.Sleep(bullet.RecoveryFromHit);

if (gameMap.Timer.IsGaming)
if (gameMap.Timer.IsGaming && bullet.Parent.PlayerState == PlayerStateType.IsSwinging)
{
bullet.Parent.PlayerState = PlayerStateType.Null;
}
@@ -328,7 +329,7 @@ namespace Gaming
);
if (bullet.CastTime > 0)
{
player.PlayerState = PlayerStateType.IsSwinging;
player.PlayerState = PlayerStateType.IsTryingToAttack;

new Thread
(() =>
@@ -336,7 +337,7 @@ namespace Gaming

Thread.Sleep(bullet.CastTime);

if (gameMap.Timer.IsGaming)
if (gameMap.Timer.IsGaming && player.PlayerState == PlayerStateType.IsTryingToAttack)
{
player.PlayerState = PlayerStateType.Null;
}


+ 3
- 4
logic/Gaming/Game.cs View File

@@ -37,10 +37,9 @@ namespace Gaming
|| gameMap.BirthPointList[playerInitInfo.birthPointIdx].Parent != null)*/
return GameObj.invalidID;

XY pos = gameMap.BirthPointList[playerInitInfo.birthPointIndex].Position;
XY pos = gameMap.BirthPointList[playerInitInfo.birthPointIndex];
// Console.WriteLine($"x,y: {pos.x},{pos.y}");
Character newPlayer = (GameData.IsGhost(playerInitInfo.characterType)) ? new Ghost(pos, GameData.characterRadius, gameMap.GetPlaceType(pos), playerInitInfo.characterType) : new Student(pos, GameData.characterRadius, gameMap.GetPlaceType(pos), playerInitInfo.characterType);
gameMap.BirthPointList[playerInitInfo.birthPointIndex].Parent = newPlayer;
gameMap.GameObjLockDict[GameObjType.Character].EnterWriteLock();
try
{
@@ -338,7 +337,7 @@ namespace Gaming
{
foreach (var keyValuePair in gameMap.GameObjDict)
{
if (((uint)keyValuePair.Key) <= GameData.numOfObjNotMap)
if (!GameData.IsMap(keyValuePair.Key))
{
gameMap.GameObjLockDict[keyValuePair.Key].EnterWriteLock();
try
@@ -369,7 +368,7 @@ namespace Gaming
var gameObjList = new List<IGameObj>();
foreach (var keyValuePair in gameMap.GameObjDict)
{
if (((uint)keyValuePair.Key) <= GameData.numOfObjNotMap)
if (!GameData.IsMap(keyValuePair.Key))
{
gameMap.GameObjLockDict[keyValuePair.Key].EnterReadLock();
try


+ 10
- 13
logic/Preparation/Utility/EnumType.cs View File

@@ -4,13 +4,12 @@ namespace Preparation.Utility
/// <summary>
/// 存放所有用到的枚举类型
/// </summary>
// public const int numOfObjNotMap = 5;在GameData中
public enum PlayerStateType
{
Null = 0,
IsAddicted = 1,
IsEscaped = 2,
IsSwinging = 3,
IsSwinging = 3,//指后摇
IsResetting = 4,
IsMoving = 5,
IsTreating = 6,
@@ -19,6 +18,7 @@ namespace Preparation.Utility
IsTreated = 9,
IsRescued = 10,
IsStunned = 11,
IsTryingToAttack = 12,//指前摇
}
public enum GameObjType
{
@@ -32,10 +32,9 @@ namespace Preparation.Utility
Wall = 6,
Grass = 7,
Generator = 8, // 发电机
BirthPoint = 9,
Doorway = 10,
EmergencyExit = 11,
OutOfBoundBlock = 12, // 范围外
Doorway = 9,
EmergencyExit = 10,
OutOfBoundBlock = 11, // 范围外
}
public enum ShapeType
{
@@ -74,7 +73,7 @@ namespace Preparation.Utility
{
Null = 0,
Assassin = 1,
Vampire = 2,
Athlete = 2,
RecoverAfterBattle = 3,
SpeedUpWhenLeavingGrass = 4,
PSkill4 = 5,
@@ -118,11 +117,9 @@ namespace Preparation.Utility
BirthPoint4 = 4,
BirthPoint5 = 5,
Wall = 6,
Grass1 = 7,
Grass2 = 8,
Grass3 = 9,
Generator = 10, // 发电机
Doorway = 11,
EmergencyExit = 12
Grass = 7,
Generator = 8, // 发电机
Doorway = 9,
EmergencyExit = 10
}
}

+ 17
- 13
logic/Preparation/Utility/GameData.cs View File

@@ -1,11 +1,13 @@
using System;
using System.Reflection.Metadata.Ecma335;

namespace Preparation.Utility
{
public static class GameData
{
#region 基本常数与常方法
public const int numOfPosGridPerCell = 1000; // 每格的【坐标单位】数
public const int numOfStepPerSecond = 20; // 每秒行走的步数
public const int numOfStepPerSecond = 100; // 每秒行走的步数
public const int frameDuration = 50; // 每帧时长

public const int lengthOfMap = 50000; // 地图长度
@@ -20,8 +22,11 @@ namespace Preparation.Utility
// public const int numOfGenerator = 7;
public const int numOfGeneratorRequiredForRepair = 5;

public const int numOfObjNotMap = 5;

private const int numOfObjNotMap = 5;
public static bool IsMap(GameObjType gameObjType)
{
return (uint)gameObjType > numOfObjNotMap;
}
public static XY GetCellCenterPos(int x, int y) // 求格子的中心坐标
{
XY ret = new(x * numOfPosGridPerCell + numOfPosGridPerCell / 2, y * numOfPosGridPerCell + numOfPosGridPerCell / 2);
@@ -44,14 +49,6 @@ namespace Preparation.Utility
return Math.Abs(PosGridToCellX(pos1) - PosGridToCellX(pos2)) <= 1 && Math.Abs(PosGridToCellY(pos1) - PosGridToCellY(pos2)) <= 1;
}

public static bool IsGhost(CharacterType characterType)
{
return characterType switch
{
CharacterType.Assassin => true,
_ => false,
};
}
#endregion
#region 角色相关
public const int characterRadius = numOfPosGridPerCell / 2; // 人物半径
@@ -84,7 +81,15 @@ namespace Preparation.Utility
public const int bulletRadius = 200; // 默认子弹半径
public const int reviveTime = 30000; // 复活时间
public const int shieldTimeAtBirth = 3000; // 复活时的护盾时间
public const int gemToScore = 4; // 一个宝石的标准加分

public static bool IsGhost(CharacterType characterType)
{
return characterType switch
{
CharacterType.Assassin => true,
_ => false,
};
}
#endregion
#region 道具相关
public const int MinPropTypeNum = 1;
@@ -92,7 +97,6 @@ namespace Preparation.Utility
public const int PropRadius = numOfPosGridPerCell / 2;
public const int PropMoveSpeed = 3000;
public const int PropMaxMoveDistance = 15 * numOfPosGridPerCell;
public const int MaxGemSize = 5; // 随机生成的宝石最大size
public const long GemProduceTime = 10000;
public const long PropProduceTime = 10000;
public const int PropDuration = 10000;


Loading…
Cancel
Save