Esempio n. 1
0
 public Projectile(World world, Character creator, float timeToLive)
     : base(world)
 {
     this.Creator = creator;
     this.RemainingTime = timeToLive;
     Alive = true;
 }
Esempio n. 2
0
 public FirstPersonModel(Character character, SceneNode eyeNode)
     : base(character)
 {
     this.EyeNode = eyeNode;
     WeaponSceneNode = EyeNode.CreateChildSceneNode();
     WeaponCenterNode = WeaponSceneNode.CreateChildSceneNode();
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
        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;
        }
Esempio n. 5
0
        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;
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
 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;
 }
Esempio n. 9
0
 public abstract IEnumerable<Character> GetEnemiesAlive(Character character);
Esempio n. 10
0
        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();
        }
Esempio n. 11
0
 public void DestroyCharacter(Character character)
 {
     Characters.Remove(character);
     character.Dispose();
 }
Esempio n. 12
0
 public void CreateMuzzleFlashEffect(Character character, Vector3 weaponSpacePosition)
 {
     CompoundEffectManager.CreateMuzzleFlashEffect(character, weaponSpacePosition);
 }
Esempio n. 13
0
 public TeleportHandler(Character actionPerformer)
     : base(actionPerformer, TeleportInterval)
 {
 }
Esempio n. 14
0
 public RangedWeaponHandler(Character actionPerformer, RangedWeapon weapon)
     : base(actionPerformer, weapon)
 {
     RangedWeapon = weapon;
     MinInaccuracy = RangedWeapon.MinInaccuracy;
 }
Esempio n. 15
0
 public WeaponHandler(Character actionPerformer, Weapon weapon)
 {
     this.ActionPerformer = actionPerformer;
     this.Weapon = weapon;
 }
Esempio n. 16
0
 public CharacterModel(Character character)
 {
     this.Character = character;
 }
Esempio n. 17
0
 public Character FindEnemy(Character attacker, Ray ray, out BodyCollider collider)
 {
     float? intersection;
     return FindEnemy(attacker, ray, out collider, out intersection);
 }
Esempio n. 18
0
 public JumpHandler(Character actionPerformer, float upVelocity, float gravityAcceleration)
     : base(actionPerformer)
 {
     this.UpVelocity = upVelocity;
     this.GravityAcceleration = gravityAcceleration;
 }
Esempio n. 19
0
        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));
 }
Esempio n. 21
0
 public ActionHandler(Character actionPerformer)
 {
     this.ActionPerformer = actionPerformer;
 }
Esempio n. 22
0
 public SpecialMoveHandler(Character actionPerformer, float interval)
 {
     this.ActionPerformer = actionPerformer;
     this.Interval = interval;
 }
Esempio n. 23
0
 public WalkHandler(Character actionPerformer, float velocity)
     : base(actionPerformer)
 {
     this.Velocity = velocity;
 }
Esempio n. 24
0
 public PlasmaBeamHandler(Character actionPerformer)
     : base(actionPerformer, PlasmaBeamInterval)
 {
 }
 public ReactionDelayStrategy(BotController controller, Character enemy, BodyCollider visibleCollider)
     : base(controller, enemy, visibleCollider)
 {
 }