コード例 #1
0
ファイル: PlayerStats.cs プロジェクト: Smoothzy/MapleServer2
 public void ResetAllocations(StatDistribution statDist)
 {
     foreach (KeyValuePair <byte, int> entry in statDist.AllocatedStats)
     {
         DecreaseMax((PlayerStatId)entry.Key, entry.Value);
     }
     statDist.ResetPoints();
 }
コード例 #2
0
        public Unit(Vector3 Position, StatDistribution Specialization, BehaviorType PrimitiveAI)
        {
            this.Position        = Position;
            IndexablePosition[0] = Position.X;
            IndexablePosition[1] = Position.Y;
            IndexablePosition[2] = Position.Z;
            this.TargetPosition  = Position;

            this.HitPoints = DefaultHP;
            this.Damage    = DefaultDamage;
            this.Speed     = DefaultSpeed;
            this.Range     = DefaultRange;
            switch (Specialization)
            {
            case StatDistribution.Health:
                this.HitPoints *= 2.0;
                this.Speed     *= 0.5f;
                break;

            case StatDistribution.Range:
                this.Range  *= 1.5f;
                this.Damage *= 0.5;
                break;

            case StatDistribution.Damage:
                this.Damage    *= 2.0;
                this.HitPoints *= 0.5;
                break;

            case StatDistribution.Speed:
                this.Speed *= 2.0f;
                this.Range *= 0.75f;
                break;

            case StatDistribution.Default:
            default:
                break;
            }

            switch (PrimitiveAI)
            {
            case BehaviorType.BuddyUp:
                this.Update = Behavior_BuddyUp;
                break;

            case BehaviorType.Default:
            default:
                this.Update = Behavior_Default;
                break;
            }
        }
コード例 #3
0
        public Unit(Vector3 Position, StatDistribution Specialization, BehaviorType PrimitiveAI)
        {
            this.Position = Position;
            IndexablePosition[0] = Position.X;
            IndexablePosition[1] = Position.Y;
            IndexablePosition[2] = Position.Z;
            this.TargetPosition = Position;

            this.HitPoints = DefaultHP;
            this.Damage = DefaultDamage;
            this.Speed = DefaultSpeed;
            this.Range = DefaultRange;
            switch (Specialization)
            {
                case StatDistribution.Health:
                    this.HitPoints *= 2.0;
                    this.Speed *= 0.5f;
                    break;
                case StatDistribution.Range:
                    this.Range *= 1.5f;
                    this.Damage *= 0.5;
                    break;
                case StatDistribution.Damage:
                    this.Damage *= 2.0;
                    this.HitPoints *= 0.5;
                    break;
                case StatDistribution.Speed:
                    this.Speed *= 2.0f;
                    this.Range *= 0.75f;
                    break;
                case StatDistribution.Default:
                default:
                    break;
            }

            switch (PrimitiveAI)
            {
                case BehaviorType.BuddyUp:
                    this.Update = Behavior_BuddyUp;
                    break;
                case BehaviorType.Default:
                default:
                    this.Update = Behavior_Default;
                    break;
            }
        }
コード例 #4
0
        public void ResetAllocations(StatDistribution statDist)
        {
            foreach (KeyValuePair <byte, int> entry in statDist.AllocatedStats)
            {
                int gainAmount = 1;
                switch ((PlayerStatId)entry.Key)
                {
                case PlayerStatId.Hp:
                    gainAmount = 10;
                    break;

                case PlayerStatId.CritRate:
                    gainAmount = 3;
                    break;

                default:
                    break;
                }
                DecreaseMax((PlayerStatId)entry.Key, entry.Value * gainAmount);
            }
            statDist.ResetPoints();
        }