public Projectile(World world, Character creator, float timeToLive) : base(world) { this.Creator = creator; this.RemainingTime = timeToLive; Alive = true; }
public FirstPersonModel(Character character, SceneNode eyeNode) : base(character) { this.EyeNode = eyeNode; WeaponSceneNode = EyeNode.CreateChildSceneNode(); WeaponCenterNode = WeaponSceneNode.CreateChildSceneNode(); }
public PlasmaBeam(World world, Character creator, Vector3 position, Vector3 velocity, int baseDamage, float timeToLive) : base(world, creator, timeToLive) { this.Position = position; this.Velocity = velocity; this.BaseDamage = baseDamage; Emitter = World.CreateParticleEmitterCluster(ParticleSystemType.PlasmaBeam, position, true); }
public override IEnumerable<Character> GetEnemiesAlive(Character character) { if (character.Record == null) throw new ArgumentException("Character does not have any battler records."); if (!TeamMapper.ContainsKey(character.Record)) throw new ArgumentException("Record does not exist in the battle system."); return from record in TeamRecordMapper[GetOpposingTeam(TeamMapper[character.Record])] where record.Character != null && record.Character.Alive select record.Character; }
public MuzzleFlashEffect(World world, Character character, Vector3 weaponWorldPosition) { this.World = world; Billboard = World.CreateDecayableBillboard(BillboardSystemType.MuzzleFlash, character.ConvertWeaponToWorldPosition(weaponWorldPosition)); for (int i = 0; i < Lights.Length; ++i) { Lights[i] = World.CreateLight(character.ConvertWeaponToWorldPosition(weaponWorldPosition + GetScaledOffset(LightOffsets[i]))); Lights[i].Type = Light.LightTypes.LT_POINT; Lights[i].SetAttenuation(5, 0, 0, 0.5f); // Soften the flash to 30% (remember, there are four lights) Lights[i].SetDiffuseColour(0.1f, 0.1f, 0.1f); } Alive = true; }
public ThirdPersonModel(Character character, SceneNode characterNode, string[] bodyEntityNames) : base(character) { BodyEntities = bodyEntityNames.Select(name => Character.World.Scene.CreateEntity(name)).ToArray(); BodyNode = characterNode.CreateChildSceneNode(); BodyNode.Yaw(MathHelper.Pi); WeaponSceneNode = BodyNode.CreateChildSceneNode(); WeaponCenterNode = WeaponSceneNode.CreateChildSceneNode(); foreach (Entity bodyEntity in BodyEntities) { BodyNode.AttachObject(bodyEntity); // To play multiple animations that does not affect each other, // blending mode cannot be average. if (bodyEntity.HasSkeleton) bodyEntity.Skeleton.BlendMode = SkeletonAnimationBlendMode.ANIMBLEND_CUMULATIVE; } WeaponCenterNode.Yaw(MathHelper.Pi); }
public AttackStrategy(BotController controller, Character enemy, BodyCollider visibleCollider) : base(controller, enemy, visibleCollider) { }
public EnemyInteractionStrategy(BotController controller, Character enemy, BodyCollider visibleCollider) : base(controller) { this.Enemy = enemy; this.VisibleCollider = visibleCollider; }
public abstract IEnumerable<Character> GetEnemiesAlive(Character character);
public BodyCollider SelectBestCollider(Character enemy) { BodyCollider[] visibleColliders = enemy.GetFrustumCollisionResult(Character.ViewFrustum).ToArray(); if (visibleColliders.Length == 0) return null; return visibleColliders.OrderByDescending(x => x.DamageMultiplier).First(); }
public void DestroyCharacter(Character character) { Characters.Remove(character); character.Dispose(); }
public void CreateMuzzleFlashEffect(Character character, Vector3 weaponSpacePosition) { CompoundEffectManager.CreateMuzzleFlashEffect(character, weaponSpacePosition); }
public TeleportHandler(Character actionPerformer) : base(actionPerformer, TeleportInterval) { }
public RangedWeaponHandler(Character actionPerformer, RangedWeapon weapon) : base(actionPerformer, weapon) { RangedWeapon = weapon; MinInaccuracy = RangedWeapon.MinInaccuracy; }
public WeaponHandler(Character actionPerformer, Weapon weapon) { this.ActionPerformer = actionPerformer; this.Weapon = weapon; }
public CharacterModel(Character character) { this.Character = character; }
public Character FindEnemy(Character attacker, Ray ray, out BodyCollider collider) { float? intersection; return FindEnemy(attacker, ray, out collider, out intersection); }
public JumpHandler(Character actionPerformer, float upVelocity, float gravityAcceleration) : base(actionPerformer) { this.UpVelocity = upVelocity; this.GravityAcceleration = gravityAcceleration; }
public Character FindEnemy(Character attacker, Ray ray, out BodyCollider collider, out float? intersection) { collider = null; if (BattleSystem == null) { intersection = Buildings.MinOrNull(x => x.GetIntersectingDistance(ray)); return null; } float? characterIntersection = null; Character closest = null; foreach (Character enemy in BattleSystem.GetEnemiesAlive(attacker)) { float? tempIntersection = enemy.GetRayCollisionResult(ray, out collider); if (tempIntersection == null) continue; if (characterIntersection == null || tempIntersection.Value < characterIntersection.Value) { characterIntersection = tempIntersection; closest = enemy; } } intersection = characterIntersection; if (characterIntersection == null) return null; // Determine if any buildings block the ray float? buildingIntersection = Buildings.MinOrNull(x => x.GetIntersectingDistance(ray)); if (buildingIntersection != null && buildingIntersection.Value < characterIntersection.Value) { intersection = buildingIntersection; return null; } return closest; }
public void CreateMuzzleFlashEffect(Character character, Vector3 weaponSpacePosition) { MuzzleFlashEffects.Add(new MuzzleFlashEffect(World, character, weaponSpacePosition)); }
public ActionHandler(Character actionPerformer) { this.ActionPerformer = actionPerformer; }
public SpecialMoveHandler(Character actionPerformer, float interval) { this.ActionPerformer = actionPerformer; this.Interval = interval; }
public WalkHandler(Character actionPerformer, float velocity) : base(actionPerformer) { this.Velocity = velocity; }
public PlasmaBeamHandler(Character actionPerformer) : base(actionPerformer, PlasmaBeamInterval) { }
public ReactionDelayStrategy(BotController controller, Character enemy, BodyCollider visibleCollider) : base(controller, enemy, visibleCollider) { }