Exemple #1
0
 public static int GetAttack(Follower f)
 {
     // 基础战力 + (星级基础战力 + 星级战力成长 * 等级) * 成长细数
     int attack = f.BasicAttack;
     attack += (int)(GetGrowAttack(f.CurStar, f.CurLevel) * f.GrowRatio);
     return attack;
 }
Exemple #2
0
        static void Main(string[] args)
        {
            PlayerObject.Instance.Self.Money = 99999;
            PlayerObject.Instance.Self.Exp = 99999;

            Follower f1 = new Follower();
            Console.WriteLine(FollowerLogic.GetAttack(f1));

            var p = FollowerLevelLogic.UpgradeRequire(f1);
            if (p != null)
            {
                Console.WriteLine(p.Exp);
                Console.WriteLine(p.Money);
            }

            FollowerLevelLogic.Upgrade(f1);
            Console.WriteLine(FollowerLogic.GetAttack(f1));

            var p2 = FollowerLevelLogic.UpgradeRequire(f1);
            if (p2 != null)
            {
                Console.WriteLine(p2.Exp);
                Console.WriteLine(p2.Money);
            }

            FollowerLevelLogic.Upgrade(f1);
            Console.WriteLine(FollowerLogic.GetAttack(f1));
        }
Exemple #3
0
 public static void GoRest(Follower follower)
 {
     var msg = new FightMessage()
     {
         PlayerId    = PlayerObject.Instance.Self.PlayerId,
         ObjectId    = follower.ObjectId,
         FightType   = FightMessage.GoToRest,
     };
     MessageManager.SendMessage("Client.Send", msg);
 }
Exemple #4
0
 public FollowerSprite(Follower follower, bool CreateAvator = false)
 {
     if(CreateAvator)
     {
         var sprite = new CCSprite(@"face/" + follower.Avatar);
         InitWithSprite(follower, sprite);
     }
     else
     {
         Init(follower);
     }
 }
Exemple #5
0
        static void Main(string[] args)
        {
            ModuleManager.Instance.Init();

            var FollowerLevelModule     = ModuleManager.Instance.GetModule("FollowerLevelModule");
            var FollowerModule          = ModuleManager.Instance.GetModule("FollowerModule");
            var FollowerStarModule      = ModuleManager.Instance.GetModule("FollowerStarModule");
            var FollowerCollectModule   = ModuleManager.Instance.GetModule("FollowerCollectModule");

            var follower = new Follower()
            {
                CurStar = 1,
                CurLevel = 2,
            };

            //-------------------------FollowerLevelModule-------------------------------
            Console.WriteLine((FollowerLevelModule.CallFunc("CanUpgrade", follower)[0].ToString()));
            Console.WriteLine(((Package)FollowerLevelModule.CallFunc("UpgradeRequire", follower)[0]).Exp);
            Console.WriteLine(FollowerLevelModule.CallFunc("Upgrade", follower)[0].ToString());
            Console.WriteLine(((Package)FollowerLevelModule.CallFunc("UpgradeRequire", follower)[0]).Exp);

            //-------------------------FollowerModule------------------------------------
            Console.WriteLine(FollowerModule.CallFunc("GetAttack", follower)[0].ToString());

            //-------------------------FollowerModule------------------------------------
            Console.WriteLine(follower.CurStar + " " + follower.CurLevel);
            Console.WriteLine(FollowerStarModule.CallFunc("CanUpgrade", follower)[0].ToString());
            follower.CurLevel = 31;
            Console.WriteLine(FollowerStarModule.CallFunc("CanUpgrade", follower)[0].ToString());
            Console.WriteLine(((Package)FollowerStarModule.CallFunc("UpgradeRequire", follower)[0]).Exp);
            Console.WriteLine(((Package)FollowerStarModule.CallFunc("UpgradeRequire", follower)[0]).Money);
            Console.WriteLine(FollowerStarModule.CallFunc("Upgrade", follower)[0].ToString());
            Console.WriteLine(follower.CurStar + " " + follower.CurLevel);

            FollowerCollect fc = new FollowerCollect()
            {
                Followers = new List<Follower>()
            };
            fc.Followers.Add(follower);
            Console.WriteLine(FollowerCollectModule.CallFunc("GetAttack", fc)[0].ToString());

            var packages = FollowerPackageModule.GetFollowerPackages();

            Console.ReadKey();
        }
Exemple #6
0
 public int GetAttack(Follower f)
 {
     return (int)(double)GetAttackFunc.Call(f)[0];
 }
Exemple #7
0
 private void OnStatusChange(Follower obj)
 {
     if (obj.IsFighting)
     {
         FollowerCollectLogic.GoRest(obj);
     }
     else
     {
         FollowerCollectLogic.GoFight(obj);
     }
 }
Exemple #8
0
 public void AddFollower(Follower f)
 {
     Followers.Add(f);
 }
Exemple #9
0
        private void Init(Follower follower)
        {
            HasBorder       = true;
            BindFollower    = follower;

            FollowerNameNode    = new CCLabel("", "Consolas", 10);
            FollowerLevelNode   = new CCLabel("", "Consolas", 10);
            FollowerStarNode    = new CCLabel("", "Consolas", 10);

            FollowerLevelNode.AnchorPoint   = CCPoint.Zero;
            FollowerStarNode.AnchorPoint    = CCPoint.Zero;

            SetFollowerName(CurrName);
            SetFollowerLevel(CurrLevel);
            SetFollowerStar(CurrStar, CurrStar + RestStar);

            this.AddChild(FollowerNameNode);
            this.AddChild(FollowerLevelNode);
            this.AddChild(FollowerStarNode);

            RefreshContentSize();
            RefreshNodePos();
        }
Exemple #10
0
 public FollowerSprite(Follower follower, CCSprite sprite)
 {
     InitWithSprite(follower, sprite);
 }
Exemple #11
0
 public static bool Upgrade(Follower f)
 {
     f.CurLevel++;
     return true;
 }
Exemple #12
0
 public static Package UpgradeRequire(Follower f)
 {
     var p = new Package();
     p.Exp = 100;
     return p;
 }
Exemple #13
0
 public static bool CanUpgrade(Follower f)
 {
     return true;
 }
Exemple #14
0
 public static void HireFollower(Follower follower)
 {
     HireFollower(follower.Id, PlayerObject.Instance.Self.PlayerId);
 }
Exemple #15
0
 public Package UpgradeRequire(Follower follower)
 {
     return (Package)UpgradeRequireFunc.Call(follower)[0];
 }
Exemple #16
0
 public bool Upgrade(Follower follower)
 {
     return (bool)UpgradeFunc.Call(follower)[0];
 }
Exemple #17
0
        private void InitWithSprite(Follower follower, CCSprite avator)
        {
            Init(follower);

            if (avator != null)
            {
                avator.AnchorPoint = CCPoint.Zero;
                FollowerAvatorNode = avator;
                FollowerAvatorNode.Position = new CCPoint(2, 2);
                this.AddChild(FollowerAvatorNode);
            }
        }
Exemple #18
0
 public void AddFollower(Follower f)
 {
     Followers.Add(f);
 }
Exemple #19
0
 public static Package UpgradeRequire(Follower f)
 {
     return null;
 }