コード例 #1
0
ファイル: Projectile.cs プロジェクト: nigelchanyk/Archetype
 public Projectile(World world, Character creator, float timeToLive)
     : base(world)
 {
     this.Creator = creator;
     this.RemainingTime = timeToLive;
     Alive = true;
 }
コード例 #2
0
 public FirstPersonModel(Character character, SceneNode eyeNode)
     : base(character)
 {
     this.EyeNode = eyeNode;
     WeaponSceneNode = EyeNode.CreateChildSceneNode();
     WeaponCenterNode = WeaponSceneNode.CreateChildSceneNode();
 }
コード例 #3
0
ファイル: PlasmaBeam.cs プロジェクト: nigelchanyk/Archetype
 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);
 }
コード例 #4
0
ファイル: TeamBattle.cs プロジェクト: nigelchanyk/Archetype
        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;
        }
コード例 #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;
        }
コード例 #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);
        }
コード例 #7
0
 public AttackStrategy(BotController controller, Character enemy, BodyCollider visibleCollider)
     : base(controller, enemy, visibleCollider)
 {
 }
コード例 #8
0
 public EnemyInteractionStrategy(BotController controller, Character enemy, BodyCollider visibleCollider)
     : base(controller)
 {
     this.Enemy = enemy;
     this.VisibleCollider = visibleCollider;
 }
コード例 #9
0
ファイル: BattleSystem.cs プロジェクト: nigelchanyk/Archetype
 public abstract IEnumerable<Character> GetEnemiesAlive(Character character);
コード例 #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();
        }
コード例 #11
0
ファイル: World.cs プロジェクト: nigelchanyk/Archetype
 public void DestroyCharacter(Character character)
 {
     Characters.Remove(character);
     character.Dispose();
 }
コード例 #12
0
ファイル: World.cs プロジェクト: nigelchanyk/Archetype
 public void CreateMuzzleFlashEffect(Character character, Vector3 weaponSpacePosition)
 {
     CompoundEffectManager.CreateMuzzleFlashEffect(character, weaponSpacePosition);
 }
コード例 #13
0
 public TeleportHandler(Character actionPerformer)
     : base(actionPerformer, TeleportInterval)
 {
 }
コード例 #14
0
 public RangedWeaponHandler(Character actionPerformer, RangedWeapon weapon)
     : base(actionPerformer, weapon)
 {
     RangedWeapon = weapon;
     MinInaccuracy = RangedWeapon.MinInaccuracy;
 }
コード例 #15
0
 public WeaponHandler(Character actionPerformer, Weapon weapon)
 {
     this.ActionPerformer = actionPerformer;
     this.Weapon = weapon;
 }
コード例 #16
0
 public CharacterModel(Character character)
 {
     this.Character = character;
 }
コード例 #17
0
ファイル: World.cs プロジェクト: nigelchanyk/Archetype
 public Character FindEnemy(Character attacker, Ray ray, out BodyCollider collider)
 {
     float? intersection;
     return FindEnemy(attacker, ray, out collider, out intersection);
 }
コード例 #18
0
ファイル: JumpHandler.cs プロジェクト: nigelchanyk/Archetype
 public JumpHandler(Character actionPerformer, float upVelocity, float gravityAcceleration)
     : base(actionPerformer)
 {
     this.UpVelocity = upVelocity;
     this.GravityAcceleration = gravityAcceleration;
 }
コード例 #19
0
ファイル: World.cs プロジェクト: nigelchanyk/Archetype
        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;
        }
コード例 #20
0
 public void CreateMuzzleFlashEffect(Character character, Vector3 weaponSpacePosition)
 {
     MuzzleFlashEffects.Add(new MuzzleFlashEffect(World, character, weaponSpacePosition));
 }
コード例 #21
0
 public ActionHandler(Character actionPerformer)
 {
     this.ActionPerformer = actionPerformer;
 }
コード例 #22
0
 public SpecialMoveHandler(Character actionPerformer, float interval)
 {
     this.ActionPerformer = actionPerformer;
     this.Interval = interval;
 }
コード例 #23
0
ファイル: WalkHandler.cs プロジェクト: nigelchanyk/Archetype
 public WalkHandler(Character actionPerformer, float velocity)
     : base(actionPerformer)
 {
     this.Velocity = velocity;
 }
コード例 #24
0
 public PlasmaBeamHandler(Character actionPerformer)
     : base(actionPerformer, PlasmaBeamInterval)
 {
 }
コード例 #25
0
 public ReactionDelayStrategy(BotController controller, Character enemy, BodyCollider visibleCollider)
     : base(controller, enemy, visibleCollider)
 {
 }