Exemple #1
0
        public Actor(ISceneParentRef parent, IPlayerParentRef owner, Guid?externalId, ITileParentRef tempTile, string visualization, string enemyVisualization, float?z, ActorNative native, RoleModelNative roleModelNative)
            : base(parent, owner, tempTile, z ?? native.DefaultZ, new DamageModel(), native)
        {
            this.varManager             = parent.VarManager;
            this.Visualization          = visualization ?? native.DefaultVisualization;
            this.EnemyVisualization     = enemyVisualization ?? native.DefaultEnemyVisualization;
            this.ExternalId             = externalId;
            this.native                 = native;
            this.SelfStrength           = roleModelNative.DefaultStrength;
            this.SelfWillpower          = roleModelNative.DefaultWillpower;
            this.SelfConstitution       = roleModelNative.DefaultConstitution;
            this.SelfSpeed              = roleModelNative.DefaultSpeed;
            this.SelfActionPointsIncome = roleModelNative.DefaultActionPointsIncome;
            this.DefaultArmor           = native.Armor.ToArray();
            this.Skills                 = new List <Skill>();
            foreach (SkillNative skill in roleModelNative.Skills)
            {
                Skills.Add(new Skill(this, skill, null, null, null, null, null, null));
            }

            this.AttackingSkill      = new Skill(this, roleModelNative.AttackingSkill, null, null, 0, null, null, null);
            this.BuffManager         = new BuffManager(this);
            this.InitiativePosition += 1f / this.Initiative;
            this.DamageModel.SetupRoleModel(this);
        }
Exemple #2
0
 private static void DamageSelf(ISceneParentRef scene, IActorParentRef actor, ProjectArena.Engine.Objects.Immaterial.Buffs.Buff buff, float time)
 {
     if (time > 0)
     {
         actor.Damage(buff.Mod * time, buff.Native.Tags);
     }
 }
 public ActiveDecoration(ISceneParentRef parent, IPlayerParentRef owner, ITileParentRef tempTile, string visualization, float?z, int?maxHealth, TagSynergy[] armor, ActiveDecorationNative native, float?mod)
     : base(parent, owner, tempTile, z ?? native.DefaultZ, new DamageModel(maxHealth ?? native.DefaultHealth, armor ?? native.DefaultArmor), native)
 {
     this.Visualization       = visualization ?? native.DefaultVisualisation;
     this.Mod                 = mod ?? native.DefaultMod;
     this.InitiativePosition += 1;
 }
Exemple #4
0
 private static void DoDamageSkill(ISceneParentRef scene, IActorParentRef owner, Tile targetTile, ProjectArena.Engine.Objects.Immaterial.Skill skill)
 {
     if (targetTile.TempObject != null)
     {
         float mod = skill.CalculateModSkillPower(targetTile.TempObject.Native.Tags);
         targetTile.TempObject.Damage(mod, skill.AggregatedTags);
     }
 }
Exemple #5
0
 public GameObject(ISceneParentRef parent, IPlayerParentRef owner, int x, int y, float z)
     : base(parent)
 {
     this.Owner   = owner;
     this.isAlive = true;
     this.X       = x;
     this.Y       = y;
     this.Z       = parent.Tiles[x][y].Height + z;
 }
Exemple #6
0
 public SpecEffect(ISceneParentRef parent, IPlayerParentRef owner, int x, int y, string visualization, float?z, SpecEffectNative native, float?duration, float?mod)
     : base(parent, owner, x, y, z ?? native.DefaultZ)
 {
     this.Visualization = visualization ?? native.DefaultVisualisation;
     this.Duration      = duration ?? native.DefaultDuration ?? null;
     this.Native        = native;
     this.Mod           = mod ?? native.DefaultMod;
     this.Affected      = true;
 }
Exemple #7
0
 private static void DoDamage(ISceneParentRef parent, Tile tile, float time)
 {
     if (time > 0)
     {
         if (tile.TempObject != null)
         {
             tile.TempObject.Damage(tile.Native.DefaultMod * time, tile.Native.Tags);
         }
     }
 }
Exemple #8
0
 public TileObject(ISceneParentRef parent, IPlayerParentRef owner, ITileParentRef tempTile, float z, DamageModel damageModel, TaggingNative native)
     : base(parent, owner, tempTile.X, tempTile.Y, z)
 {
     this.Native              = native;
     this.TempTile            = tempTile;
     this.DamageModel         = damageModel;
     this.InitiativePosition += parent.GetNextRandom() / 10000f;
     this.Affected            = true;
     this.HealthRevealed      = false;
 }
Exemple #9
0
 public Player(ISceneParentRef parent, string id, string userId, int?team)
 {
     this.Team      = team;
     this.Parent    = parent;
     this.Id        = id;
     this.UserId    = userId;
     this.KeyActors = new List <Actor>();
     this.Status    = PlayerStatus.Playing;
     this.Left      = false;
 }
Exemple #10
0
 public Tile(ISceneParentRef parent, int x, int y, TileNative native, int?height)
 {
     this.Owner    = null;
     this.Parent   = parent;
     this.X        = x;
     this.Y        = y;
     this.Height   = height ?? native.DefaultHeight;
     this.Native   = native;
     this.Affected = true;
     this.Revealed = native.RevealedByDefault;
 }
Exemple #11
0
 private static void DoDamageTempTile(ISceneParentRef parent, SpecEffect effect, float time)
 {
     if (time > 0)
     {
         var target = parent.Tiles[effect.X][effect.Y].TempObject;
         if (target != null)
         {
             target.Damage(effect.Mod * time, effect.Native.Tags);
         }
     }
 }
        public static bool DefeatConditionDuel(ISceneParentRef scene, IPlayerParentRef player)
        {
            foreach (Actor actor in player.KeyActors)
            {
                if (actor.IsAlive)
                {
                    return(false);
                }
            }

            return(true);
        }
        public static bool WinConditionDuel(ISceneParentRef scene)
        {
            int countOfRemainedPlayers = 0;

            foreach (Player player in scene.Players)
            {
                if (player.Status == PlayerStatus.Playing)
                {
                    countOfRemainedPlayers++;
                }
            }

            return(countOfRemainedPlayers <= 1);
        }
 public static bool DefeatConditionDummy(ISceneParentRef scene, IPlayerParentRef player)
 {
     return(false);
 }
Exemple #15
0
 public IdObject(ISceneParentRef parent)
 {
     this.Parent = parent;
     this.Id     = parent.GetNextId();
 }
Exemple #16
0
 private static void DoSelfDamage(ISceneParentRef scene, ActiveDecoration activeDecoration)
 {
     activeDecoration.Damage(activeDecoration.Mod, activeDecoration.Native.Tags);
 }
Exemple #17
0
 private static void DamageSelfPurge(ISceneParentRef scene, IActorParentRef actor, ProjectArena.Engine.Objects.Immaterial.Buffs.Buff buff)
 {
     DamageSelf(scene, actor, buff, 1);
 }
Exemple #18
0
 private static void DoDamageOnStep(ISceneParentRef parent, Tile tile)
 {
     DoDamage(parent, tile, 1);
 }
 public static bool WinConditionDummy(ISceneParentRef scene)
 {
     return(false);
 }
Exemple #20
0
 private static void DoDamageTempTileDeath(ISceneParentRef parent, SpecEffect effect)
 {
     DoDamageTempTile(parent, effect, 1);
 }