public EnemySpellInfo(HOSTILESPELL _id, string _name, int _basevalue, int _basevalue2, int _castTime, int _cooldown, string _icon, int _DoTgap, int _ticksCount, DAMAGETYPE _damagetype, int _targetsAmount, TARGETTYPE _targettype, DAMAGESOURCE _damagesource, DEBUFF _debuff, string _description, bool _misdirectable, MOB _summon) { ID = _id; name = _name; baseValue = _basevalue; baseValue2 = _basevalue2; castTime = _castTime; cooldown = _cooldown; icon = _icon; DoTgap = _DoTgap; ticksCount = _ticksCount; damagetype = _damagetype; targetsAmount = _targetsAmount; targetType = _targettype; damageSource = _damagesource; debuff = _debuff; description = _description; misdirectable = _misdirectable; summon = _summon; }
public Troop GetTargets(TARGETTYPE type, int amount, Soldier[] _excluded = null, Soldier sol = null) { Troop troop; Soldier[] tars; amount = Mathf.Min(amount, SoldierAmount); if (type == TARGETTYPE.EVERYONE) { amount = 16; } tars = new Soldier[amount]; switch (type) { case TARGETTYPE.EVERYONE: { for (int i = 0; i < 16; i++) { tars[i] = soldier[i]; } } break; case TARGETTYPE.NEARBY: { } break; case TARGETTYPE.BY_HEALTH: { tars = GetSoldiersByHealth(amount); } break; case TARGETTYPE.FIRSTCOLUMN: { int bas = 16; int _dead = 0; int _which = 0; do { bas -= 4; _which = 0; _dead = 0; for (int i = 0; i < 4; i++) { if (null != soldierPlace[bas + i]) { if (soldierPlace[bas + i].isDead) { _dead++; } else { tars[_which++] = soldierPlace[bas + i]; } } } }while (_dead >= 4); } break; case TARGETTYPE.RANDOM: { int _Soldieramount = 16; // ilosc graczy Soldier[] _Soldiers = new Soldier[_Soldieramount]; // tablica graczy int counter = 0; if (amount > SoldierAmount) // jesli zywych graczy jest mniej niz ilosc celow, zmniejszamy ilosc celow { amount = SoldierAmount; } // losowanie celow bez zwracania for (int i = 0; i < 16; i++) { // wypelniamy tablice graczy zywymi graczami if (!soldier[i].isDead) { _Soldiers[counter++] = soldier[i]; } else { _Soldieramount--; } } for (int j = 0; j < amount; j++) { if (amount == 1) { int r = Random.Range(0, _Soldieramount); tars[j] = _Soldiers[r]; } else { int r = Random.Range(0, _Soldieramount); tars[j] = _Soldiers[r]; _Soldiers[r] = _Soldiers[_Soldieramount - 1]; _Soldieramount--; } } } break; default: Debug.Log(type); break; } if (_excluded != null) { for (int i = 0; i < amount; i++) { if (isExcluded(tars[i], _excluded)) { tars[i] = null; } } } troop = new Troop(amount, tars); return(troop); }
public void SetTargetType(TARGETTYPE set) { targetType = set; }
private void AddESpellInfo(HOSTILESPELL _id, string _name, int _basevalue, int _basevalue2, int _castTime, int _cooldown, string _icon, int _DoTgap, int _tickCount, DAMAGETYPE _damagetype, int _targetsAmount, TARGETTYPE _targettype, DAMAGESOURCE _damagesource, DEBUFF _debuff, string _desc, bool _misdirectable, MOB _summon = MOB.NUL) { espellInfo[(int)_id] = new EnemySpellInfo( _id, _name, (int)(_basevalue * MULTIP_MOD), (int)(_basevalue2 * MULTIP_MOD), (int)(_castTime * CAST_MOD), (int)(_cooldown * CD_MOD), _icon, (int)(_DoTgap * GAP_MOD), _tickCount, _damagetype, _targetsAmount, _targettype, _damagesource, _debuff, _desc, _misdirectable, _summon); }