You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Character.Skill.cs 2.3 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using Preparation.Utility;
  2. using Preparation.Interface;
  3. using System.Collections.Generic;
  4. namespace GameClass.GameObj
  5. {
  6. public partial class Character
  7. {
  8. private readonly CharacterType characterType;
  9. public CharacterType CharacterType => characterType;
  10. private readonly IOccupation occupation;
  11. public IOccupation Occupation => occupation;
  12. private readonly Dictionary<ActiveSkillType, ActiveSkill> activeSkillDictionary = new();
  13. public Dictionary<ActiveSkillType, ActiveSkill> ActiveSkillDictionary => activeSkillDictionary;
  14. public ActiveSkill FindActiveSkill(ActiveSkillType activeSkillType)
  15. {
  16. if (Occupation.ListOfIActiveSkill.Contains(activeSkillType))
  17. {
  18. return ActiveSkillDictionary[activeSkillType];
  19. }
  20. return new NullSkill();
  21. }
  22. public bool IsGhost()
  23. {
  24. return GameData.IsGhost(CharacterType);
  25. }
  26. protected Character(XY initPos, int initRadius, CharacterType characterType) :
  27. base(initPos, initRadius, GameObjType.Character)
  28. {
  29. this.ReSetCanMove(true);
  30. this.score = 0;
  31. this.buffManager = new BuffManager();
  32. this.occupation = OccupationFactory.FindIOccupation(characterType);
  33. this.MaxHp = this.hp = Occupation.MaxHp;
  34. this.MoveSpeed = this.orgMoveSpeed = Occupation.MoveSpeed;
  35. this.BulletOfPlayer = this.OriBulletOfPlayer = Occupation.InitBullet;
  36. this.concealment = Occupation.Concealment;
  37. this.alertnessRadius = Occupation.AlertnessRadius;
  38. this.viewRange = Occupation.ViewRange;
  39. this.characterType = characterType;
  40. this.speedOfOpeningOrLocking = Occupation.SpeedOfOpeningOrLocking;
  41. this.speedOfClimbingThroughWindows = Occupation.SpeedOfClimbingThroughWindows;
  42. this.speedOfOpenChest = Occupation.SpeedOfOpenChest;
  43. foreach (var activeSkill in this.Occupation.ListOfIActiveSkill)
  44. {
  45. this.ActiveSkillDictionary.Add(activeSkill, SkillFactory.FindActiveSkill(activeSkill));
  46. }
  47. Debugger.Output(this, "constructed!");
  48. }
  49. }
  50. }