public EnemyAttributeFormat(int slotID, MonsterTable dbData, int?currentHP = null) { this.EnemeyType = ENEMY_TYPE.MONSTER; this.SlotID = slotID; this.DBEnemyID = dbData.ID; this.DBNameID = dbData.MonsterNameID; this.EXPOutput = dbData.EXPOutput; this.AuraOutput = dbData.AuraOutput; this.DimensionChipOutput = dbData.DimensionChipOutput; this.DimensionChipOutputProbability = dbData.DimensionChipOutputProbability; this.Level = dbData.Level; this.HPMax = dbData.HPMax; if (currentHP != null) { this.HP = currentHP.Value; } else { this.HP = this.HPMax; } this.RES = dbData.RES; this.ATK = dbData.ATK; this.MAG = dbData.MAG; this.DEF = dbData.DEF; this.AC = dbData.AC; this.CRI = dbData.CRI; this.PEN = dbData.PEN; this.HIT = dbData.HIT; this.AVD = dbData.AVD; }
public static void SetMonsterParameter(SB2_MON_PARM pParm, ref ENEMY_TYPE pType) { pType.radius = pParm.Radius; pType.category = pParm.Category; pType.level = pParm.Level; pType.blue_magic_no = pParm.Blue; pType.max.hp = pParm.MaxHP; pType.max.mp = (Int16)pParm.MaxMP; pType.bonus.gil = pParm.WinGil; pType.bonus.exp = pParm.WinExp; pType.bonus.card = (UInt32)pParm.Card; pType.bonus.item = pParm.WinItems; for (Int16 num = 0; num < 6; num = (Int16)(num + 1)) { pType.mot[(Int32)num] = FF9BattleDB.Animation[(Int32)pParm.Mot[(Int32)num]]; } for (Int16 num = 0; num < 3; num = (Int16)(num + 1)) { pType.cam_bone[(Int32)num] = pParm.Bone[(Int32)num]; } pType.die_snd_no = pParm.DieSfx; pType.p_atk_no = pParm.Konran; for (Int16 num = 0; num < 6; num = (Int16)(num + 1)) { pType.icon_bone[(Int32)num] = pParm.IconBone[(Int32)num]; pType.icon_y[(Int32)num] = pParm.IconY[(Int32)num]; pType.icon_z[(Int32)num] = pParm.IconZ[(Int32)num]; } }
//初期化 public void Initialize(ENEMY_TYPE enemy_type, float move_speed, int hit_point) { _enemy_type = enemy_type; _move_speed = move_speed; _hit_point = hit_point; switch (_enemy_type) { case ENEMY_TYPE.TYPE_A: _enemy_move = new StraightMove( ); break; case ENEMY_TYPE.TYPE_B: _enemy_move = new ArcMove( ); break; case ENEMY_TYPE.TYPE_C: _enemy_move = new WaveMove( ); break; default: Assert.IsNotNull(_enemy_move, "[Enemy]敵の種類が入ってません"); break; } }
public EnemyAttributeFormat(int slotID, BossTable dbData) { this.EnemeyType = ENEMY_TYPE.BOSS; this.SlotID = slotID; this.DBEnemyID = dbData.ID; this.DBNameID = dbData.BossNameID; this.EXPOutput = dbData.EXPOutput; this.AuraOutput = dbData.AuraOutput; this.DimensionChipOutput = dbData.DimensionChipOutput; this.DimensionChipOutputProbability = dbData.DimensionChipOutputProbability; this.Level = dbData.Level; this.HPMax = dbData.HPMax; this.HP = this.HPMax; this.RES = dbData.RES; this.ATK = dbData.ATK; this.MAG = dbData.MAG; this.DEF = dbData.DEF; this.AC = dbData.AC; this.CRI = dbData.CRI; this.PEN = dbData.PEN; this.HIT = dbData.HIT; this.AVD = dbData.AVD; }
public void BonusSupportAbilitiesAttack() { var hasCategory = new Func <ENEMY_TYPE, EnemyCategory, Boolean>((enemy, category) => (enemy.category & (Int16)category) != 0); if (!Target.IsPlayer) { ENEMY_TYPE enemy = btl_util.getEnemyTypePtr(Target.Data); if (Caster.HasSupportAbility(SupportAbility1.BirdKiller) && hasCategory(enemy, EnemyCategory.Flight) || Caster.HasSupportAbility(SupportAbility1.BugKiller) && hasCategory(enemy, EnemyCategory.Soul) || Caster.HasSupportAbility(SupportAbility1.StoneKiller) && hasCategory(enemy, EnemyCategory.Stone) || Caster.HasSupportAbility(SupportAbility1.UndeadKiller) && hasCategory(enemy, EnemyCategory.Undead) || Caster.HasSupportAbility(SupportAbility1.DragonKiller) && hasCategory(enemy, EnemyCategory.Dragon) || Caster.HasSupportAbility(SupportAbility1.DevilKiller) && hasCategory(enemy, EnemyCategory.Devil) || Caster.HasSupportAbility(SupportAbility1.BeastKiller) && hasCategory(enemy, EnemyCategory.Beast) || Caster.HasSupportAbility(SupportAbility1.ManEater) && hasCategory(enemy, EnemyCategory.Humanoid)) { Context.Attack = (Int16)(Context.Attack * 3 >> 1); } } if (Caster.HasSupportAbility(SupportAbility1.MPAttack) && Caster.CurrentMp > 0) { Context.Attack = (Int16)(Context.Attack * 3 >> 1); Context.Flags |= BattleCalcFlags.MpAttack; } }
public EnemySaveDataFormat(EnemyAttributeFormat attributes, CommonAttributeFormat attributesAggregateBuff) { this.EnemyID = attributes.DBEnemyID; this.Type = attributes.EnemeyType; this.AttributesAggregateBuff = attributesAggregateBuff.CloneEx(); // this.HP = attributes.HP; }
protected k514EnemyController CreateEnemy(ENEMY_TYPE index, Vector3 pos) { k514EnemyController tmp = k514SystemManager.EnemyMgr.GetPooledEnemy(index); tmp.transform.position = pos; return(tmp); }
//MUTATORS public void SetType(ENEMY_TYPE type) { switch (type) { case ENEMY_TYPE.SHOOTER: SetShooter(); break; case ENEMY_TYPE.CHASER: SetChaser(); break; case ENEMY_TYPE.BRUTE: SetBrute(); break; case ENEMY_TYPE.SNIPER: SetSniper(); break; case ENEMY_TYPE.TURRET: SetTurret(); break; case ENEMY_TYPE.BOSS: SetBoss(); break; } }
public bool FindConditionQuest(QUEST_TYPE?[] type, DIFFICULTY_TYPE?difficulty, ENEMY_TYPE enemy) { bool is_find = false; questTable.ForEach(delegate(QuestTableData table) { if (!is_find) { EnemyTable.EnemyData enemyData = Singleton <EnemyTable> .I.GetEnemyData((uint)table.GetMainEnemyID()); if (enemyData != null && enemyData.type == enemy && (!difficulty.HasValue || (difficulty.GetValueOrDefault() == table.difficulty && difficulty.HasValue))) { int num = 0; int num2 = type.Length; while (true) { if (num >= num2) { return; } QUEST_TYPE?nullable = type[num]; if (nullable.HasValue && table.questType == type[num]) { break; } num++; } is_find = true; } } }); return(is_find); }
//allocate EnemyType results to enemyTypes List from pos, to len number of elements public void SetEnemyRule(ENEMY_TYPE enemyType, int pos, int len) { //fill with enemyType passed in for (int i = pos; i < pos + len; ++i) //this will fall over if len + pos >= enemyTypes.Count { enemyTypes[i] = enemyType; } }
public Enemy(Vector2 position, Vector2 velocity, TextureMap map, TextureMap tMap, ENEMY_TYPE t) : base(position, map, ENTITY_TYPE.AI) { Type = t; Gun = new List<Turret>(); Gun.Add(new Turret((tMap))); rand = new Random(); mVelocity = velocity; }
public Enemy(Vector2 position, TextureMap map, TextureMap tMap, ENEMY_TYPE t) : base(position, map, ENTITY_TYPE.AI) { Type = t; Gun = new List<Turret>(); Gun.Add(new Turret((tMap))); rand = new Random(); mVelocity = Constants.DEFAULT_ENEMY_VELOCITY; }
public override void init(Player _player, string target, int val) { base.init(_player, target, val); type = ENEMY_TYPE.NONE; if (Enum.IsDefined(typeof(ENEMY_TYPE), target)) { type = (ENEMY_TYPE)(int)Enum.Parse(typeof(ENEMY_TYPE), target); } }
public void Collect(ENEMY_TYPE type, QUEST_TYPE quest_type) { List <ENEMY_TYPE> list = _GetEnemyTypeList(quest_type); if (list != null && list.IndexOf(type) == -1) { list.Add(type); } }
//By the time we get to CreateEnemy the EnemySpawner, Dice and EnemySpawnRules have done their job i.e. decided what enemy to spawn. public Enemy CreateEnemy(ENEMY_TYPE enemyType_, Vector2 enemyPos_, int wave_ = 1) { //TODO: 0 hardcoded in next line for now, will be safe unless multiple towers introduced Enemy enemy = new Enemy(enemyType_, gameAssets.TowerListItem(0).Pos, enemyPos_); enemy.Texture = gameAssets.EnemyTextureList[(int)enemyType_]; gameAssets.EnemyListAdd(enemy); return(enemy); }
public k514EnemyController GetPooledEnemy(ENEMY_TYPE index) { ENEMY_CNT++; int Cnt = enemyDisablePool[(int)index].Count; k514EnemyController tmp = (enemyDisablePool[(int)index])[Cnt - 1]; tmp.gameObject.SetActive(true); enemyDisablePool[(int)index].RemoveAt(Cnt - 1); return(tmp); }
//By the time we get to CreateEnemy the EnemySpawner, Dice and EnemySpawnRules have done their job i.e. decided what enemy to spawn. public Enemy CreateEnemy(ENEMY_TYPE enemyType_, Vector2 enemyPos_, int wave_ = 1) { //TODO: 0 hardcoded in next line for now, will be safe unless multiple towers introduced Enemy enemy = new Enemy(enemyType_, gameAssets.TowerListItem(0).Pos, enemyPos_); enemy.Texture = gameAssets.EnemyTextureList[(int)enemyType_]; gameAssets.EnemyListAdd(enemy); return enemy; }
public Enemy(ENEMY_TYPE enemyType_, Vector2 playerPos_, Vector2 pos_) { pos = pos_; //status = ENEMY_STATUS.OK; enemyType = enemyType_; InitialiseEnemyVariables(); playerPos = playerPos_; this.Width = 32; this.Height = 32; Active = true; }
private void SelectTexture(ENEMY_TYPE type) { switch (type) { case ENEMY_TYPE.SHOOTER: transform.GetChild(0).gameObject.SetActive(false); transform.GetChild(1).gameObject.SetActive(true); transform.GetChild(2).gameObject.SetActive(false); break; } }
List<ENEMY_TYPE> enemyTypes; //use this list to decide what was spawned based on dice roll. #endregion Fields #region Constructors public EnemySpawnRules(Dice dice_, ENEMY_TYPE defaultEnemyType_) { dice = dice_; enemyTypes = new List<ENEMY_TYPE>(dice.MaxRoll); //fill with default to start with for (int i = 0; i < dice.MaxRoll; ++i) { enemyTypes.Add(defaultEnemyType_); } }
List <ENEMY_TYPE> enemyTypes; //use this list to decide what was spawned based on dice roll. public EnemySpawnRules(Dice dice_, ENEMY_TYPE defaultEnemyType_) { dice = dice_; enemyTypes = new List <ENEMY_TYPE>(dice.MaxRoll); //fill with default to start with for (int i = 0; i < dice.MaxRoll; ++i) { enemyTypes.Add(defaultEnemyType_); } }
public void SetChaser() { type = ENEMY_TYPE.CHASER; gameObject.transform.localScale = new Vector3(0.5f, 0.5f, 0); targetingRange = 8; MaxHealth = (int)(50 * modifier); CurrentHealth = MaxHealth; speed = 1.6f; touchDamage = (int)(10 * modifier); sr.color = Color.magenta; hb.SetHealth(MaxHealth, CurrentHealth); }
public void SetShooter() { type = ENEMY_TYPE.SHOOTER; gameObject.transform.localScale = new Vector3(0.5f, 0.5f, 0); MaxHealth = (int)(50 * modifier); CurrentHealth = MaxHealth; speed = 1.0f * modifier; touchDamage = (int)(10 * modifier); sr.color = Color.yellow; hb.SetHealth(MaxHealth, CurrentHealth); weapon.Set(1.0f * modifier, 0.5f * modifier, 3.0f * modifier, (int)(10 * modifier), 1, 0, 1); }
public void SetBrute() { type = ENEMY_TYPE.BRUTE; gameObject.transform.localScale = new Vector3(1f, 1f, 0); MaxHealth = (int)(200 * modifier); CurrentHealth = MaxHealth; speed = 0.5f * modifier; touchDamage = (int)(10 * modifier); sr.color = Color.cyan; hb.SetHealth(MaxHealth, CurrentHealth); weapon.Set(1f * modifier, 0.5f * modifier, 2.0f * modifier, (int)(50 * modifier), 1, 0, 3); }
public void SetSniper() { type = ENEMY_TYPE.SNIPER; gameObject.transform.localScale = new Vector3(0.25f, 0.25f, 0); targetingRange = 10; MaxHealth = (int)(50 * modifier); CurrentHealth = MaxHealth; speed = 1.0f * modifier; touchDamage = (int)(10 * modifier); sr.color = Color.white; hb.SetHealth(MaxHealth, CurrentHealth); weapon.Set(0.33f * modifier, 0.7f * modifier, 3.0f * modifier, (int)(50 * modifier), 1, 0, 1); }
public static void SetBonus(ENEMY_TYPE et) { BONUS btlBonus = battle.btl_bonus; btlBonus.gil += et.bonus.gil; btlBonus.exp += et.bonus.exp; Byte num1 = 0; while (num1 < 16 && btlBonus.item[num1] != Byte.MaxValue) { ++num1; } if (num1 < 16) { if (Comn.random8() < 1 && et.bonus.item[3] != Byte.MaxValue) { btlBonus.item[num1++] = et.bonus.item[3]; et.bonus.item[3] = Byte.MaxValue; } else if (Comn.random8() < 32 && et.bonus.item[2] != Byte.MaxValue) { btlBonus.item[num1++] = et.bonus.item[2]; et.bonus.item[2] = Byte.MaxValue; } else if (Comn.random8() < 96 && et.bonus.item[1] != Byte.MaxValue) { btlBonus.item[num1++] = et.bonus.item[1]; et.bonus.item[1] = Byte.MaxValue; } if (et.bonus.item[0] != Byte.MaxValue) { Byte[] numArray = btlBonus.item; Int32 index = num1; //int num2 = 1; //byte num3 = (byte)(index + num2); Int32 num4 = et.bonus.item[0]; numArray[index] = (Byte)num4; } } if (btlBonus.card != Byte.MaxValue || et.bonus.card >= 100U || Comn.random8() >= 32) { return; } btlBonus.card = (Byte)et.bonus.card; }
// Main function that will be called by other scripts to spawn enemies public GameObject SpawnEnemy(Vector3 position, Quaternion rotation, ENEMY_TYPE type) { switch (type) { case ENEMY_TYPE.ENEMY_MISSILE: return(SpawnMissile(position, rotation)); case ENEMY_TYPE.ENEMY_V200: return(SpawnV200(position, rotation)); case ENEMY_TYPE.ENEMY_M113: return(SpawnM113(position, rotation)); case ENEMY_TYPE.ENEMY_AMX10: return(SpawnAMX10(position, rotation)); case ENEMY_TYPE.V200_RUMBLE_TYPE1: return(SpawnV200RumbleType1(position, rotation)); case ENEMY_TYPE.V200_RUMBLE_TYPE2: return(SpawnV200RumbleType2(position, rotation)); case ENEMY_TYPE.V200_RUMBLE_TYPE3: return(SpawnV200RumbleType3(position, rotation)); case ENEMY_TYPE.V200_RUMBLE_TYPE4: return(SpawnV200RumbleType4(position, rotation)); case ENEMY_TYPE.M113_RUMBLE_TYPE1: return(SpawnM113RumbleType1(position, rotation)); case ENEMY_TYPE.M113_RUMBLE_TYPE2: return(SpawnM113RumbleType2(position, rotation)); case ENEMY_TYPE.M113_RUMBLE_TYPE3: return(SpawnM113RumbleType3(position, rotation)); case ENEMY_TYPE.M113_RUMBLE_TYPE4: return(SpawnM113RumbleType4(position, rotation)); default: return(null); } }
private void SetStats(ENEMY_TYPE type, NavMeshAgent agent) { switch (type) { case ENEMY_TYPE.SCRATCHER: hp = 15; SetAgent( agent, SCRATCHER_SPEED, SCRATCHER_ACCELERATION, SCRATCHER_STOPPING_DISTANCE, SCRATCHER_RADIUS, SCRATCHER_HEIGHT ); break; case ENEMY_TYPE.RUNNER: hp = 10; SetAgent( agent, RUNNER_SPEED, RUNNER_ACCELERATION, RUNNER_STOPPING_DISTANCE, RUNNER_RADIUS, RUNNER_HEIGHT ); break; case ENEMY_TYPE.SHOOTER: hp = 20; SetAgent( agent, SHOOTER_SPEED, SHOOTER_ACCELERATION, SHOOTER_STOPPING_DISTANCE, SHOOTER_RADIUS, SHOOTER_HEIGHT ); break; } }
void TypeCheck(ENEMY_TYPE type) { switch (type) { case ENEMY_TYPE.GOOMBA: EnemyGoomba(); break; case ENEMY_TYPE.ARCHER: EnemyArcher(); break; case ENEMY_TYPE.GHOST: EnemyGhost(); break; case ENEMY_TYPE.MEDUSA: break; } }
public void SetTurret() { type = ENEMY_TYPE.TURRET; gameObject.transform.localScale = new Vector3(0.5f, 0.5f, 0); targetingRange = 1000; MaxHealth = (int)(100 * modifier); CurrentHealth = MaxHealth; speed = 1.0f * modifier; touchDamage = (int)(10 * modifier); sr.color = Color.white; sprite = Resources.Load <Sprite>("Turret"); sr.sprite = sprite; collider.isTrigger = true; hb.SetHealth(MaxHealth, CurrentHealth); weapon.Set(3, 0.5f * modifier, 3.0f * modifier, (int)(50 * modifier), 1, 0, 3); }
private void SelectRandomEnemyType() { int number = Random.Range(0, 3); switch (number) { case 0: type = ENEMY_TYPE.SCRATCHER; break; case 1: type = ENEMY_TYPE.SHOOTER; break; case 2: type = ENEMY_TYPE.RUNNER; break; } SelectTexture(type); }
//Tell the factory to make us another enemy, because we only got here from spawnTimer going off!!! private void SpawnEnemy(Object source, ElapsedEventArgs e) { if (!timerStopped) { ENEMY_TYPE enemy_type = esr.RandomiseEnemy(); Enemy enemy = factoryOrder.CreateEnemy(enemy_type, spawnCircle.GetPointNearLastRandomAngle()); //if (enemy.Cost > pointsToSpend) //do not spawn enemy and tell the owner that the EnemySpawner has stopped if (enemy.Cost > pointsToSpend) { this.StopSpawner(); return; } else { pointsToSpend -= enemy.Cost; this.ResetTimer(); } } }
public static void OrganizeEnemyData(FF9StateBattleSystem btlsys) { for (Int32 i = 0; i < BTL_SCENE.GetMonCount(); i++) { ENEMY_TYPE et = btlsys.enemy[i].et; BTL_DATA btl_DATA = btlsys.btl_data[4 + i]; btl_DATA.level = et.level; btl_DATA.max.at = (Int16)((60 - btl_DATA.elem.dex) * 40 << 2); btl_para.InitATB(btl_DATA); btl_DATA.cur.at = (Int16)(Comn.random16() % (Int32)btl_DATA.max.at); btl_DATA.weapon = (ItemAttack)null; btl_stat.InitCountDownStatus(btl_DATA); btl_mot.HideMesh(btl_DATA, btl_DATA.mesh_current, false); if (btl_DATA.bi.slave != 0) { btl_DATA.cur.at = 0; btl_DATA.cur.at_coef = 0; btl_DATA.gameObject.transform.localRotation = btl_DATA.rot; btl_DATA.gameObject.transform.localPosition = btl_DATA.evt.posBattle; btl_DATA.currentAnimationName = btl_DATA.mot[(Int32)btl_DATA.bi.def_idle]; btl_mot.setMotion(btl_DATA, btl_DATA.currentAnimationName); btl_mot.setSlavePos(btl_DATA, ref btl_DATA.base_pos); UnityEngine.Object.Destroy(btl_DATA.gameObject); UnityEngine.Object.Destroy(btl_DATA.getShadow()); btl_DATA.gameObject = btl_util.GetMasterEnemyBtlPtr().Data.gameObject; } else { btl_DATA.base_pos[0] = btl_DATA.evt.posBattle[0]; btl_DATA.base_pos[1] = btl_DATA.evt.posBattle[1]; btl_DATA.base_pos[2] = btl_DATA.evt.posBattle[2]; btl_DATA.currentAnimationName = btl_DATA.mot[(Int32)btl_DATA.bi.def_idle]; btl_DATA.evt.animFrame = (Byte)(Comn.random8() % (Int32)GeoAnim.geoAnimGetNumFrames(btl_DATA)); } } }
public void SetBoss() { type = ENEMY_TYPE.BOSS; gameObject.transform.localScale = new Vector3(3f, 3f, 0); MaxHealth = (int)(400 * modifier); CurrentHealth = MaxHealth; speed = 0.75f * modifier; touchDamage = (int)(20 * modifier); targetingRange = 5.0f; float r = UnityEngine.Random.Range(0.5f, 1.0f); float g = UnityEngine.Random.Range(0.5f, 1.0f); float b = UnityEngine.Random.Range(0.5f, 1.0f); sr.color = new Color(r, g, b); sprite = Resources.Load <Sprite>("Boss"); sr.sprite = sprite; hb.SetHealth(MaxHealth, CurrentHealth); weapon.Set(2.5f * modifier, 0.1f * modifier, 4.0f * modifier, (int)(20 * modifier), 3, 45, 3); weapon2.Set(4f * modifier, 0.1f * modifier, 5.0f * modifier, (int)(20 * modifier), 1, 0, 3); }