예제 #1
0
 protected override void OnUpdate()
 {
     Entities.WithAll <MeleeAttack, ZoxID, Targeter>().ForEach((Entity e, ref MeleeAttack hitter, ref ZoxID zoxID, ref Targeter targeter) =>
     {
         if (hitter.didHit == 1)
         {
             hitter.didHit = 0;
             DamageSystem.AddDamage(World.EntityManager, e, targeter.nearbyCharacter.character, 0, hitter.attackDamage);
         }
     });
 }
예제 #2
0
파일: Bootstrap.cs 프로젝트: Deus0/zoxel
 public void GiveExperienceToPlayers()
 {
     foreach (var player in sys.playerSystemGroup.playerSpawnSystem.controllers.Values)
     {
         foreach (var defender in sys.characterSystemGroup.characterSpawnSystem.characters.Values)
         {
             if (player.Index != defender.Index)
             {
                 DamageSystem.AddDamage(EntityManager, player, defender, 0, UnityEngine.Random.Range(1, 12));
                 //break;
             }
         }
     }
 }
예제 #3
0
 public void Initialize(Unity.Entities.World space)
 {
     skillsSystem         = space.GetOrCreateSystem <SkillsSystem>();
     damageSystem         = space.GetOrCreateSystem <DamageSystem>();
     shootSystem          = space.GetOrCreateSystem <ShootSystem>();
     shootCompleterSystem = space.GetOrCreateSystem <ShootCompleterSystem>();
     meleeDamageSystem    = space.GetOrCreateSystem <MeleeDamageSystem>();
     meleeCompleterSystem = space.GetOrCreateSystem <MeleeCompleterSystem>();
     AddSystemToUpdateList(skillsSystem);
     AddSystemToUpdateList(damageSystem);
     AddSystemToUpdateList(shootSystem);
     AddSystemToUpdateList(shootCompleterSystem);
     AddSystemToUpdateList(meleeDamageSystem);
     AddSystemToUpdateList(meleeCompleterSystem);
     SetLinks();
 }