ComRole.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /** @format */
  2. import {ComType, EntityIndex} from '../lib/Const'
  3. import {ECSComponent} from '../lib/ECSComponent'
  4. import {cObject} from '../../collision/Object'
  5. import {IRoleConfig} from '../../config/RoleConfig'
  6. import {ISkillConfig} from '../../config/SkillConfig'
  7. import {EntryObj, FightInfo, IBuff} from '../core/GameInterface'
  8. import {ENTRY} from '../../enums/Enum'
  9. import {idNum} from '../../proto/typedef'
  10. import {IEquip} from '../../interface/GlobalInterface'
  11. @ECSComponent(ComType.ComRole)
  12. export class ComRole {
  13. public roleCfg: IRoleConfig
  14. public width: number
  15. public height: number
  16. public spineEntity: number
  17. public group: number
  18. public lastHP: number
  19. public nowHP: number
  20. public lastShieldHP: number
  21. public shieldHP: number
  22. public HPDirty: boolean
  23. public transDirty: boolean //变身标记
  24. public transID: number //变身前的ID
  25. public attackRange: number // 攻击范围 近战固定值100 远程配置攻击范围-1000
  26. public invincible: boolean // 是否无敌
  27. //----基础属性---
  28. public HP: number // 血量 >=0
  29. public attack: number // 攻击力 >=0
  30. public spellAttack: number // 法术攻击力 >=0
  31. public realAttack: number // 真实攻击力 >=0
  32. public defense: number // 防御力 >=0
  33. public spellDefense: number // 法术防御力 >=0
  34. public attackCrit: number // 攻击力暴击率 >=0
  35. public critNum: number // 暴击率倍数 >=0
  36. public hit: number // 攻击力命中 >=0
  37. public dodge: number // 闪避 >=0
  38. public attackSpeed: number // 攻击速度 5000-50000
  39. public moveSpeed: number // 移动速度
  40. //----攻击速度影响下面两个值---
  41. public attackCD: number // 攻击间隔时间
  42. public attackTime: number // 攻击时间
  43. public castTime: number[] // 技能时间
  44. public enterTime: number // 入场时间
  45. public dieTime: number // 死亡时间
  46. public attackNum: number //攻击次数
  47. public killNum: number //杀人次数
  48. //词条
  49. public entryMap: Map<ENTRY, EntryObj> = new Map<ENTRY, EntryObj>()
  50. //身体
  51. public cObject: cObject
  52. //技能配置
  53. public skills: ISkillConfig[] = []
  54. //所有的技能CD
  55. public skillCDs: number[] = []
  56. //技能入场CD
  57. public enterCDs: number[] = []
  58. //当前冷却
  59. public skillCountDowns: number[] = []
  60. //自己当前持有的buff
  61. public buffs: IBuff[] = []
  62. public buffDirty: boolean = false
  63. //自己的召唤物
  64. public babys: EntityIndex[] = []
  65. //召唤物的主人
  66. public parent: EntityIndex
  67. public parentRoleID: number
  68. //战斗信息
  69. public fightInfo: FightInfo[] = []
  70. //掉落
  71. public drop: idNum
  72. // 是否是额外投放敌人
  73. public isExtraEnemy: boolean
  74. //装备
  75. public equips: IEquip[]
  76. }