示例#1
0
 public static SerializablePlayerModel Default(string username, SkillDb db)
 => new SerializablePlayerModel(
     3220, 3218, 0,
     new Dictionary <SkillID, ISkillModel>
 {
     { db.Attack, new NormalSkillModel(db.Attack, 0, 0) },
     { db.Defense, new NormalSkillModel(db.Defense, 0, 0) },
     { db.Strength, new NormalSkillModel(db.Strength, 0, 0) },
     { db.Hitpoints, new NormalSkillModel(db.Hitpoints, 0, 0) },
     { db.Ranged, new NormalSkillModel(db.Ranged, 0, 0) },
     { db.Prayer, new NormalSkillModel(db.Prayer, 0, 0) },
     { db.Magic, new NormalSkillModel(db.Magic, 0, 0) },
     { db.Cooking, new NormalSkillModel(db.Cooking, 0, 0) },
     { db.Woodcutting, new NormalSkillModel(db.Woodcutting, 0, 0) },
     { db.Fletching, new NormalSkillModel(db.Fletching, 0, 0) },
     { db.Fishing, new NormalSkillModel(db.Fishing, 0, 0) },
     { db.Firemaking, new NormalSkillModel(db.Firemaking, 0, 0) },
     { db.Crafting, new NormalSkillModel(db.Crafting, 0, 0) },
     { db.Smithing, new NormalSkillModel(db.Smithing, 0, 0) },
     { db.Mining, new NormalSkillModel(db.Mining, 0, 0) },
     { db.Herblore, new NormalSkillModel(db.Herblore, 0, 0) },
     { db.Agility, new NormalSkillModel(db.Agility, 0, 0) },
     { db.Thieving, new NormalSkillModel(db.Thieving, 0, 0) },
     { db.Slayer, new NormalSkillModel(db.Slayer, 0, 0) },
     { db.Farming, new NormalSkillModel(db.Farming, 0, 0) },
     { db.Runecrafting, new NormalSkillModel(db.Runecrafting, 0, 0) }
 },
     Enumerable.Repeat(ItemStack.Empty, PlayerInventoryComponent.BackpackSize).ToArray(),
     Enumerable.Repeat(ItemStack.Empty, PlayerInventoryComponent.BankSize).ToArray(),
     Enumerable.Repeat(ItemStack.Empty, PlayerEquipmentContainer.EquipmentMaxSize).ToArray(),
     username,
     (int)PlayerComponent.Title.Normal,
     PlayerAppearance.Default,
     10);
示例#2
0
 void OnTriggerExit2D(Collider2D cll)
 {
     if (cll.gameObject.layer == LayerMask.NameToLayer("Player"))
     {
         MCSkill = null;
         SetToDefault();
     }
 }
示例#3
0
 bool checkMP(SkillDb Skill)
 {
     if (mainControll.myMC.MpDefault < Skill.MPCost)
     {
         return(false);
     }
     return(true);
 }
示例#4
0
 void SetEffectToDefault1()
 {
     mainControll.useSkill = false;
     mainControll.myAnim.runtimeAnimatorController = LocalSkill;
     mainControll.myAnim.Play("Idle");
     mainControll.attack = 0;
     indexSkillEnable    = 0;
     EnableSkill         = null;
 }
示例#5
0
 void GetSkillEffect(SkillDb Skill)
 {
     mainControll.attack             = 0;
     mainControll.myMC.MpDefault    -= Skill.MPCost;
     mainControll.moveSpeed         *= (1 + Skill.SpeedUp);
     mainControll.myMC.HpDefault     = (int)(mainControll.myMC.HpDefault * (1 + Skill.HpRegen));
     mainControll.myMC.DodgeDefault *= 1 + Skill.DodgeUp;
     mainControll.myMC.AMDefault     = (int)(mainControll.myMC.AMDefault * (1 + Skill.AMUp));
     mainControll.damgeAttack        = (int)(mainControll.damgeAttack * (1 + Skill.DameUp));
     mainControll.useSkill           = true;
     EnableSkill = Skill;
 }
示例#6
0
 void SetEffectToDefault(SkillDb Skill)
 {
     mainControll.moveSpeed         /= (1 + Skill.SpeedUp);
     mainControll.myMC.DodgeDefault /= 1 + Skill.DodgeUp;
     mainControll.myMC.AMDefault     = (int)(mainControll.myMC.AMDefault / (1 + Skill.AMUp));
     mainControll.damgeAttack        = (int)(mainControll.damgeAttack / (1 + Skill.DameUp));
     mainControll.useSkill           = false;
     transform.position              = new Vector3(transform.position.x, transform.position.y, 0);
     mainControll.attack             = 0;
     if (indexSkillEnable == 4)
     {
         mainControll.myAnim.runtimeAnimatorController = LocalSkill;
         indexSkillEnable = 0;
         EnableSkill      = null;
     }
 }
示例#7
0
 void OnTriggerEnter2D(Collider2D cll)
 {
     if (cll.gameObject.layer == LayerMask.NameToLayer("Player"))
     {
         if (MCSkill != null)
         {
             return;
         }
         mainSkillControll main = cll.gameObject.GetComponent <mainSkillControll>();
         if (main.indexSkillEnable == 0)
         {
             return;
         }
         if (main.EnableSkill != null)
         {
             MCSkill = main.EnableSkill;
             GetAtOne();
         }
     }
 }
示例#8
0
        public SocketAndPlayerDatabaseDispatch([NotNull] IServiceProvider services)
        {
            _services = services ?? throw new ArgumentNullException(nameof(services));

            _players = services.ThrowOrGet <PlayerCatalogue>();
            _db      = services.ThrowOrGet <PlayerJsonDatabase>();
            _server  = services.ThrowOrGet <IGameServer>();
            _log     = services.ThrowOrGet <ILogger>();
            _skills  = services.ThrowOrGet <SkillDb>();

            var cfg = services.ThrowOrGet <IConfigurationService>();


            _socket = new Socket(SocketType.Stream, ProtocolType.Tcp)
            {
                SendTimeout    = cfg.GetInt(ConfigKey.SocketSendTimeout),
                ReceiveTimeout = cfg.GetInt(ConfigKey.SocketReceiveTimeout)
            };

            _greeting       = cfg.Get(ConfigKey.Greeting);
            _backlog        = cfg.GetInt(ConfigKey.SocketBacklog);
            _listenEndpoint = cfg.GetIpAddress(ConfigKey.ListenEndPoint);
            _revision       = cfg.GetInt(ConfigKey.Revision);

            _rng = new Random();

            _crypto = Utils.GetCrypto(cfg.Get(ConfigKey.PrivateLoginKeyDir), false);

            // start the service as soon as we're initialized
            Task.Run(StartListening).ContinueWith(t =>
            {
                _log.Debug(this, $"EntryPoint listen task terminated in status: Completed: {t.IsCompleted} Faulted: {t.IsFaulted} Cancelled: {t.IsCanceled}");
                if (t.Exception != null)
                {
                    _log.Exception(this, "EntryPoint contained exception.", t.Exception);
                }
            });
        }
示例#9
0
 public SkillDb(SkillDb skillDb)
 {
     // TODO: Complete member initialization
     this.skillDb = skillDb;
 }
示例#10
0
    string OnLoadDescription(SkillDb SkillDB)
    {
        string ret = "";

        switch (SkillDB.IdSkill)
        {
        case 1:
            ret = "War falls from the sky, dealing " + SkillDB.DameSkill.ToString("0.") + " damage and repelling everything around " + SkillDB.CoolDown.ToString("0.0") + " of cooldown.";
            break;

        case 2:
            ret = "Anything will be shackled by chains in " + SkillDB.Duration + " seconds. It takes " + SkillDB.CoolDown.ToString("0.0") + " seconds to cooldown.";
            break;

        case 3:
            ret = "War rushes forward to 400 distance and deals " + SkillDB.DameSkill.ToString("0.") + " damage to alltargets. Cooldown in " + SkillDB.CoolDown.ToString("0.0") + " seconds.";
            break;

        case 4:
            ret = "War invoking the destruction horse appears, war will be increased to " + SkillDB.CristUp * 100 + "% in Cristical chance and " + SkillDB.DodgeUp * 100 + "% in Dodge." + SkillDB.CoolDown.ToString("0.0") + "seconds of cooldown.";
            break;

        case 5:
            ret = "Deadly Light appears causing " + SkillDB.DameSkill.ToString("0.") + " damage to all targets and regen " + SkillDB.HpRegen * 100 + "% Hit Points for Death. Need " + SkillDB.CoolDown.ToString("0.0") + " seconds to cooldown.";
            break;

        case 6:
            ret = "Soul barrier causes all targets to be delayed by " + SkillDB.Slow * 100 + "% speed in" + SkillDB.Duration + "second. It takes cooldown from" + SkillDB.CoolDown.ToString("0.0") + "seconds.";
            break;

        case 7:
            ret = "Death's swing his Scythe while jumping forward and dealing" + SkillDB.DameSkill.ToString("0.") + "damage to all targets. Need" + SkillDB.CoolDown.ToString("0.0") + "seconds to cooldown.";
            break;

        case 8:
            ret = "Death is increased by" + SkillDB.DameUp * 100 + "% of basic damage and" + SkillDB.SpeedUp + "% of speed move. Skill cooldown for" + SkillDB.CoolDown.ToString("0.0") + "seconds.";
            break;

        case 9:
            ret = "The Famile's whip makes" + SkillDB.DameSkill.ToString("0.") + "damage for 2 times for every target. Cooldown after" + SkillDB.CoolDown.ToString("0.0") + "seconds.";
            break;

        case 10:
            break;

        case 11:
            break;

        case 12:
            break;

        case 13:
            break;

        case 14:
            break;

        case 15:
            break;

        case 16:
            break;
        }
        return(ret);
    }
 public SkillController()
 {
     dao = new SkillDb();
 }