public BossCasterAiBehaviour(CharacterInstance character) { base.Character = character; this.m_parameters = ParseParameters(character.Character.BossAiParameters); this.m_targetingBehaviour = new MonsterTargetingAiBehaviour(character); switch (character.Character.CoreAiBehaviour) { case AiBehaviourType.MonsterRanged: this.m_attackBehaviour = new PursuitAndRangedAttackAiBehaviour(character); break; case AiBehaviourType.MonsterRangedToMelee: this.m_attackBehaviour = new PursuitAndRangedMeleeAttackAiBehaviour(character); break; case AiBehaviourType.MonsterPuffer: this.m_attackBehaviour = new StationarySkillUseAiBehaviour(character, SkillType.PoisonPuff); break; default: this.m_attackBehaviour = new PursuitAndMeleeAttackAiBehaviour(character); break; } for (int i = 0; i < this.m_parameters.PerkTypes.Count; i++) { PerkType perkType = this.m_parameters.PerkTypes[i]; PerkInstance item = new PerkInstance(); item.Type = perkType; item.Modifier = ConfigPerks.GetBestModifier(perkType); character.BossPerks.PerkInstances.Add(item); } this.m_skillTimer.set(ConfigSkills.SHARED_DATA[this.m_parameters.SkillType].BossFirstCastDelay); }
public BossSummonerAiBehaviour(CharacterInstance character) { base.Character = character; this.m_parameters = ParseParameters(character.Character.BossAiParameters); this.m_skillData = ConfigSkills.BOSS_SUMMONER_SKILLS[this.m_parameters.SkillType]; this.m_targetingBehaviour = new MonsterTargetingAiBehaviour(character); switch (character.Character.CoreAiBehaviour) { case AiBehaviourType.MonsterRanged: this.m_attackBehaviour = new PursuitAndRangedAttackAiBehaviour(character); break; case AiBehaviourType.MonsterRangedToMelee: this.m_attackBehaviour = new PursuitAndRangedMeleeAttackAiBehaviour(character); break; case AiBehaviourType.MonsterPuffer: this.m_attackBehaviour = new StationarySkillUseAiBehaviour(character, SkillType.PoisonPuff); break; default: this.m_attackBehaviour = new PursuitAndMeleeAttackAiBehaviour(character); break; } if (this.m_skillData.AiTriggerType == TriggerType.TimeInterval) { this.m_timer = new ManualTimer(this.m_skillData.AiTriggerModifier); } }
private void removeAiBehaviour(CharacterInstance c) { AiBehaviour item = this.m_characterToAiBehaviourMapping[c]; item.cleanup(); this.m_characterToAiBehaviourMapping.Remove(c); this.m_aiBehaviours.Remove(item); }
public IdleUntilProvokedAiBehaviour(CharacterInstance character) { base.Character = character; if (base.Character.UsesRangedAttack) { this.m_attackBehaviour = new PursuitAndRangedAttackAiBehaviour(character); } else { this.m_attackBehaviour = new PursuitAndMeleeAttackAiBehaviour(character); } }
public IdleUntilWithinAggroDistanceAiBeheaviour(CharacterInstance character) { base.Character = character; if (character.IsBoss) { switch (character.Character.BossAiBehaviour) { case AiBehaviourType.BossSummoner: this.m_primaryAi = new BossSummonerAiBehaviour(character); break; case AiBehaviourType.BossCaster: this.m_primaryAi = new BossCasterAiBehaviour(character); break; } } if (this.m_primaryAi == null) { switch (character.Character.CoreAiBehaviour) { case AiBehaviourType.MonsterMelee: this.m_primaryAi = new MonsterMeleeAiBehaviour(character); return; case AiBehaviourType.MonsterRanged: this.m_primaryAi = new MonsterRangedAiBehaviour(character); return; case AiBehaviourType.MonsterRangedToMelee: this.m_primaryAi = new MonsterRangedToMeleeAiBehaviour(character); return; case AiBehaviourType.MonsterFireblast: this.m_primaryAi = new MonsterFireblastAiBehaviour(character); return; case AiBehaviourType.MonsterPuffer: this.m_primaryAi = new MonsterPufferAiBehaviour(character); return; } Debug.LogError("No suitable attack AI behaviour specified for " + character.Name); } }
protected void FixedUpdate() { ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon; for (int i = 0; i < this.m_aiBehaviours.Count; i++) { AiBehaviour behaviour = this.m_aiBehaviours[i]; if (behaviour.UpdateTimer.tick(Time.deltaTime * Time.timeScale)) { CharacterInstance character = behaviour.Character; float dt = behaviour.UpdateTimer.timeElapsed(); behaviour.UpdateTimer.reset(); behaviour.preUpdate(dt); if (((activeDungeon == null) || (activeDungeon.ActiveRoom == null)) || ((activeDungeon.CurrentGameplayState != GameplayState.ACTION) && (activeDungeon.CurrentGameplayState != GameplayState.START_CEREMONY_STEP1))) { CmdSetCharacterVelocityAndFacing.ExecuteStatic(character, Vector3.zero, character.PhysicsBody.Transform.forward); } else if ((((activeDungeon.CurrentGameplayState != GameplayState.START_CEREMONY_STEP1) && !character.IsDead) && (!character.isAttacking() && (character.AttackCooldownTimer <= 0f))) && (!character.ExternallyControlled && !character.Stunned)) { behaviour.update(dt); } } } }
public MonsterPufferAiBehaviour(CharacterInstance character) { base.Character = character; this.m_targetingBehaviour = new MonsterTargetingAiBehaviour(character); this.m_attackBehaviour = new StationarySkillUseAiBehaviour(character, SkillType.PoisonPuff); }
private void addAiBehaviour(CharacterInstance c) { AiBehaviour behaviour = null; switch (c.Character.CoreAiBehaviour) { case AiBehaviourType.HeroMelee: behaviour = new HeroMeleeAiBehaviour(c); break; case AiBehaviourType.HeroRanged: behaviour = new HeroRangedAiBehaviour(c); break; case AiBehaviourType.CompanionMelee: behaviour = new CompanionMeleeAiBehaviour(c); break; case AiBehaviourType.CompanionRanged: behaviour = new CompanionRangedAiBehaviour(c); break; case AiBehaviourType.SupportClone: behaviour = new SupportCloneAiBehaviour(c); break; case AiBehaviourType.SupportDecoy: behaviour = new SupportDecoyAiBehaviour(c); break; case AiBehaviourType.SupportMeleeAtk: behaviour = new SupportMeleeAttackAiBehaviour(c); break; case AiBehaviourType.SupportRangedAtk: behaviour = new SupportRangedAttackAiBehaviour(c); break; case AiBehaviourType.SupportDasher: behaviour = new SupportSkillUseAiBehaviour(c, SkillType.Omnislash, false, null); break; case AiBehaviourType.SupportWhirler: behaviour = new SupportSkillUseAiBehaviour(c, SkillType.Whirlwind, false, null); break; case AiBehaviourType.SupportLeaper: behaviour = new SupportSkillUseAiBehaviour(c, SkillType.Leap, false, null); break; case AiBehaviourType.SupportCharger: behaviour = new SupportSkillUseAiBehaviour(c, SkillType.Charge, true, null); break; case AiBehaviourType.SupportSplashSlammer: { List <PerkType> list2 = new List <PerkType>(); list2.Add(PerkType.SkillUpgradeSlam4); List <PerkType> perkTypes = list2; behaviour = new SupportSkillUseAiBehaviour(c, SkillType.Slam, false, perkTypes); break; } } if ((behaviour == null) && (c.Character.CoreAiBehaviour != AiBehaviourType.None)) { if (c.IsPlayerCharacter) { Debug.LogWarning("Assigning IdleUntilWithinAggroDistanceAiBeheaviour for player character."); } behaviour = new IdleUntilWithinAggroDistanceAiBeheaviour(c); } if (behaviour != null) { if (c.IsSupport) { behaviour.UpdateTimer.set(ConfigGameplay.AI_UPDATE_INTERVAL * 0.25f); behaviour.UpdateTimer.tick(behaviour.UpdateTimer.originalTimeSet() * 0.95f); } else { behaviour.UpdateTimer.tick(UnityEngine.Random.Range((float)(ConfigGameplay.AI_UPDATE_INTERVAL * 0.75f), (float)(ConfigGameplay.AI_UPDATE_INTERVAL * 0.95f))); } this.m_characterToAiBehaviourMapping.Add(c, behaviour); this.m_aiBehaviours.Add(behaviour); } }