Ejemplo n.º 1
0
 public static int GetAttack(Follower f)
 {
     // 基础战力 + (星级基础战力 + 星级战力成长 * 等级) * 成长细数
     int attack = f.BasicAttack;
     attack += (int)(GetGrowAttack(f.CurStar, f.CurLevel) * f.GrowRatio);
     return attack;
 }
Ejemplo n.º 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));
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 4
0
 public FollowerSprite(Follower follower, bool CreateAvator = false)
 {
     if(CreateAvator)
     {
         var sprite = new CCSprite(@"face/" + follower.Avatar);
         InitWithSprite(follower, sprite);
     }
     else
     {
         Init(follower);
     }
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 6
0
 public int GetAttack(Follower f)
 {
     return (int)(double)GetAttackFunc.Call(f)[0];
 }
Ejemplo n.º 7
0
 private void OnStatusChange(Follower obj)
 {
     if (obj.IsFighting)
     {
         FollowerCollectLogic.GoRest(obj);
     }
     else
     {
         FollowerCollectLogic.GoFight(obj);
     }
 }
Ejemplo n.º 8
0
 public void AddFollower(Follower f)
 {
     Followers.Add(f);
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 10
0
 public FollowerSprite(Follower follower, CCSprite sprite)
 {
     InitWithSprite(follower, sprite);
 }
Ejemplo n.º 11
0
 public static bool Upgrade(Follower f)
 {
     f.CurLevel++;
     return true;
 }
Ejemplo n.º 12
0
 public static Package UpgradeRequire(Follower f)
 {
     var p = new Package();
     p.Exp = 100;
     return p;
 }
Ejemplo n.º 13
0
 public static bool CanUpgrade(Follower f)
 {
     return true;
 }
Ejemplo n.º 14
0
 public static void HireFollower(Follower follower)
 {
     HireFollower(follower.Id, PlayerObject.Instance.Self.PlayerId);
 }
Ejemplo n.º 15
0
 public Package UpgradeRequire(Follower follower)
 {
     return (Package)UpgradeRequireFunc.Call(follower)[0];
 }
Ejemplo n.º 16
0
 public bool Upgrade(Follower follower)
 {
     return (bool)UpgradeFunc.Call(follower)[0];
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 18
0
 public void AddFollower(Follower f)
 {
     Followers.Add(f);
 }
Ejemplo n.º 19
0
 public static Package UpgradeRequire(Follower f)
 {
     return null;
 }