Ejemplo n.º 1
0
 public List<ObjectEntity> getTargets(MyCharacterController src, TargetType targettype)
 {
     List<ObjectEntity> ret = new List<ObjectEntity>();
     string tag = "";
     switch (targettype) {
         case TargetType.ALLCHARACTER:
             tag = TagList.Character;
             break;
         case TargetType.EXPEXTPLAYER:
             tag = TagList.Character;
             break;
         case TargetType.ENEMY:
             tag = TagList.Character;
             break;
         case TargetType.FRIEND:
             tag = TagList.Character;
             break;
         case TargetType.TRAP:
             tag = TagList.Trap;
             break;
         case TargetType.ITEM:
             tag = TagList.Item;
             break;
     }
     switch (this.BasisParameter.EffectRange) {
         case Range.AROUND:
             ret = src.getAroundObjects(tag);
             break;
         case Range.FLOOR:
             ret =  GameController.DungeonInformation.getObjectes(tag);
             break;
         case Range.ROOM:
             if (src.InRoom != null) {
                 ret = GameController.DungeonInformation.getAllObjectInRoomWithTag(src.CurrentPosition,tag);
             }
             else { ret = src.getAroundObjects(tag); }
             break;
         case Range.OWN:
             ret.Add(src);
             return ret;
     }
     if (tag == TagList.Character) {
         switch (this.BasisParameter.TargetType) {
             case TargetType.EXPEXTPLAYER:
                 ret.RemoveAll(c => c is PlayerController);
                 break;
             case TargetType.ENEMY:
                 ret = ret.FindAll( c => (c as MyCharacterController).CurrentHostile == MyCharacterController.Hostile.AGGRESIVE);
                 break;
             case TargetType.FRIEND:
                 ret = ret.FindAll(c => (c as MyCharacterController).CurrentHostile != MyCharacterController.Hostile.AGGRESIVE);
                 break;
         }
     }
     return ret;
 }