Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        int state = this.GetComponent <InfoControl>().getState();

        if (state == PEOPLE.BEGIN_SKILL)
        {
            SKILL current_skill = this.GetComponent <InfoControl>().current_skill;
            Debug.Log("current_skill.Boot();");
            current_skill.Boot();
            return;
        }
        else if (state == PEOPLE.EXECUTE_SKILL)
        {
            SKILL current_skill = this.GetComponent <InfoControl>().current_skill;
            Debug.Log("Attack()");
            current_skill.Attack();
            return;
        }
        //剩余情况下 为基础技能更新冷却时间
        if (this.GetComponent <InfoControl>().basicSkill.cd_time_left > 0)
        {
            // Debug.Log("basicSkill.cd_time_left: "+ this.GetComponent<InfoControl>().basicSkill.cd_time_left);

            this.GetComponent <InfoControl>().basicSkill.cd_time_left -= this.GetComponent <InfoControl>().basicSkill.cd_speed *Time.deltaTime;
        }
    }
Esempio n. 2
0
 void HandleGetKeyUpEvent(SKILL _skill)
 {
     if (_skill.need_dir)
     {
         _skill.SetDirection(Dir);
     }
     if (_skill.need_pos)
     {
         if (_skill.IsPosValid(Pos))
         {
             Debug.Log("PosValid");
             Debug.Log(Pos);
             _skill.SetTargetPos(Pos);
         }
         else
         {
             Debug.Log("PosInValid");
             Debug.Log(Pos);
             //位置不在距离范围内,做异常处理 放在主角所在位置?  纸张还是要被使用
             _skill.SetTargetPos(this.transform.position);
         }
         Debug.Log("Already SetTargetPos:");
         Debug.Log(Pos);
         //UI显示位置
         highlightPosCube.SetActive(true);
         highlightPosCube.transform.position = Pos;
     }
     this.GetComponent <InfoControl>().next_skill_to_begin = _skill;
     highlightPosCube.SetActive(false);
 }
Esempio n. 3
0
        public void setCurLevel(SKILL skill, int lvl)
        {
            int i_skill = Convert.ToInt32(skill);

            curLevel[i_skill] = lvl;
            //Hitpoints and prayer are the only two skills which can hit 0.
            if (curLevel[i_skill] <= 0)
            {
                if (skill == SKILL.HITPOINTS || skill == SKILL.PRAYER)
                {
                    curLevel[i_skill] = 0;
                }
                else
                {
                    curLevel[i_skill] = 1;
                }
            }
            if (skill == SKILL.PRAYER)
            {
                if (curLevel[i_skill] <= 0 || lvl == 0)
                {
                    curLevel[i_skill] = 0;
                    player.getPackets().sendMessage("You have run out of Prayer points, please recharge your prayer at an altar.");
                    Prayer.deactivateAllPrayers(player);
                }
            }
        }
        public bool DeleteSkill(SKILL Entity)
        {
            using (KARYABDBEntities db = new KARYABDBEntities())
            {
                try
                {
                    db.Configuration.ProxyCreationEnabled = false;
                    //var employer = new Employ { Id = 1 };
                    //ctx.Employ.Attach(employer);
                    //ctx.Employ.Remove(employer);
                    //ctx.SaveChanges();
                    SKILL       entity = db.SKILLS.FirstOrDefault(q => q.ID == Entity.ID);
                    OWNERSSKILL Owner  = db.OWNERSSKILLS.FirstOrDefault(q => q.SKILLID == Entity.ID);
                    db.OWNERSSKILLS.Attach(Owner);
                    db.OWNERSSKILLS.Remove(Owner);
                    db.SaveChanges();
                    db.SKILLS.Attach(entity);
                    db.SKILLS.Remove(entity);
                    db.SaveChanges();

                    return(true);
                }
                catch (Exception e)
                {
                    return(false);
                }
            }
        }
Esempio n. 5
0
    public void BeginSkill(int playerIdx, int skillID, int attackID)
    {
        if (isEnd)
        {
            return;
        }
        SKILL skill = DataCfgMgr.instance.GetSkill(skillID);

        if (skill == null)
        {
            return;
        }
        Type skillTemplate = null;

        if (!mSkillTemplateMap.TryGetValue(skill.template, out skillTemplate))
        {
            return;
        }
        SkillBase skillInst = GetSkillFromPool(skill.template);

        if (skillInst == null)
        {
            skillInst = Activator.CreateInstance(skillTemplate) as SkillBase;
        }

        if (skillInst.Begin(playerIdx, skillID, attackID, skill.template))
        {
            mSkillInsts.Add(skillInst);
        }
    }
Esempio n. 6
0
    public void addPageSkill(string _page_name)
    {
        SKILL _skill = null;

        switch (_page_name)
        {
        case "GoldenPage":
            _skill = new SKILL_FLASH(this.gameObject, id_count++);
            break;

        case "WhitePage":
            _skill = new SKILL_REVIVE(this.gameObject, id_count++);
            break;

        case "BlackPage":
            _skill = new SKILL_HIDE(this.gameObject, id_count++);
            break;

        default:
            Debug.Log("Error! Invalid _page_name!");
            break;
        }
        if (_skill != null)
        {
            pageSkills.Add(_skill);
        }

        //print for test
        outputPageSkillsForTest();
    }
Esempio n. 7
0
        SkillDTO GetSkillDto(SKILL skill)
        {
            SkillDTO skillDto = new SkillDTO();

            skillDto.id         = skill.Id;
            skillDto.UserId     = skill.UserId;
            skillDto.shortcutId = skill.ShortcutId;
            skillDto.nextLevel  = skill.NextLevel;
            skillDto.coldTime   = skill.ColdTime;
            skillDto.range      = skill.Range;
            skillDto.applyValue = skill.ApplyValue;
            skillDto.applyTime  = skill.ApplyTime;
            skillDto.mp         = skill.Mp;
            skillDto.dis        = skill.Dis;
            skillDto.back       = skill.Back;
            skillDto.skillId    = skill.SkillId;
            SkillModelDTO skillModelDto = new SkillModelDTO();

            skillModelDto.code = skill.Code;
            skillModelDto.name = skill.Name;
            SkillInitial skillInitial = SkillInitialProperty.mapSkill[skillDto.skillId];

            skillModelDto.info          = skillInitial.info;
            skillModelDto.icon_name     = skillInitial.icon_name;
            skillModelDto.applyType     = skillInitial.applyType;
            skillModelDto.applyProperty = skillInitial.applyProperty;
            skillModelDto.releaseType   = skillInitial.releaseType;
            skillModelDto.efx_name      = skillInitial.efx_name;
            skillModelDto.aniname       = skillInitial.aniname;

            skillDto.SkillModelDto = skillModelDto;
            return(skillDto);
        }
Esempio n. 8
0
 // Use this for initialization
 void Start()
 {
     if (basic_skill_name == "SKILL_TRAP_SLOW")
     {
         basicSkill = new SKILL_TRAP_SLOW(this.gameObject, id_count++);
     }
 }
Esempio n. 9
0
    bool HandleBasicSkillEvent()
    {
        SKILL         _basicSkill   = this.GetComponent <InfoControl>().basicSkill;
        SkillJoystick skillJoystick = baseSkillUI.GetComponent <SkillJoystick>();

        if (_basicSkill.cd_time_left > 0)
        {
        }
        else
        {
            if (skillJoystick.isPressed())//在UI上接收点击信息 实时获取方向/位置信息
            {
                Debug.Log("Input.GetKey");
                skillJoystick.waspressed = true;
                HandleGetKeyEvent(_basicSkill);
                return(true);
            }
            else if (skillJoystick.waspressed)//如果用户现在没按下但是曾经按下,表示放开了按键
            {
                Debug.Log("Input.GetKeyUp");
                HandleGetKeyUpEvent(_basicSkill);
                skillJoystick.waspressed = false;
                return(true);
            }
        }
        return(false);
    }
Esempio n. 10
0
        public void addXp(SKILL skill, double exp)
        {
            int skillIndex = Convert.ToInt32(skill);
            int oldLevel   = getLevelForXp(skill);

            xp[skillIndex] += exp;
            if (xp[skillIndex] >= MAXIMUM_EXP)
            {
                xp[skillIndex] = MAXIMUM_EXP;
            }
            int newLevel = getLevelForXp(skill);

            if (newLevel > oldLevel && newLevel <= 99)
            {
                if (skillIndex != 3)
                {
                    curLevel[skillIndex] = newLevel;
                    maxLevel[skillIndex] = newLevel;
                }
                else
                {
                    curLevel[3]++;
                    maxLevel[3]++;
                }
                levelUp(player, skill);
            }
            player.getPackets().sendSkillLevel(skill);
        }
Esempio n. 11
0
 void increaseCD(SKILL s)
 {
     if (s != SKILL.ALQUIMISTA)
     {
         currentcdAlquimista -= 3;
         if (currentcdAlquimista < 0)
         {
             currentcdAlquimista = 0;
         }
     }
     if (s != SKILL.ARQUEIRO)
     {
         currentcdArqueiro -= 3;
         if (currentcdArqueiro < 0)
         {
             currentcdArqueiro = 0;
         }
     }
     if (s != SKILL.DEFENSOR)
     {
         currentcdDefensor -= 3;
         if (currentcdDefensor < 0)
         {
             currentcdDefensor = 0;
         }
     }
     if (s != SKILL.MAGO)
     {
         currentcdMago -= 3;
         if (currentcdMago < 0)
         {
             currentcdMago = 0;
         }
     }
 }
Esempio n. 12
0
 private void OnSkill(SKILL skillIndex)
 {
     mSkillColdTime = mPlayer.GetComponent <Hero>().GetSkillColdTime(skillIndex);
     if (mColdTime <= 0)
     {
         mColdTime = mSkillColdTime;
     }
 }
Esempio n. 13
0
        public ActionResult DeleteConfirmed(string id)
        {
            SKILL sKILL = db.SKILL.Find(id);

            db.SKILL.Remove(sKILL);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 14
0
 public bool Update(SKILL entity)
 {
     db.Entry(entity).State = EntityState.Modified;
     if (db.SaveChanges() > 0)
     {
         return(true);
     }
     return(false);
 }
Esempio n. 15
0
 public bool Insert(SKILL entity)
 {
     db.SKILLs.Add(entity);
     if (db.SaveChanges() > 0)
     {
         return(true);
     }
     return(false);
 }
Esempio n. 16
0
    protected SkillEfxItem CreateAndInitEfxItem(string resPath, float yOffset)
    {
        int        objID;
        GameObject efxObj = ResMgr.instance.CreateObject(resPath, out objID);

        if (efxObj == null)
        {
            Debug.LogError("SkillBase Begin() efxObj == null");
            return(null);
        }
        // record efx obj
        SkillBaseInfoCom efxBaseInfoCom = efxObj.GetComponent <SkillBaseInfoCom>();

        if (efxBaseInfoCom == null)
        {
            efxBaseInfoCom = efxObj.AddComponent <SkillBaseInfoCom>();
        }
        efxBaseInfoCom.Init(mPlayerIdx, mAttackID, mSkillID);

        // init position
        ObjectUtil.IdentityObj(efxObj.transform);
        Vector3 worldPos = mAttackMoveCom.GetCurWorldPos();

        efxObj.transform.position = new Vector3(worldPos.x, worldPos.y + yOffset, 0.0f);


        SkillEfxItem item = new SkillEfxItem();

        item.efxTr = efxObj.transform;
        SKILL skill = DataCfgMgr.instance.GetSkill(mSkillID);

        item.existTimer = skill.duration;

        // init speed

        Vector3 carSpeed  = BattleInstance.instance.GetHeroCarVecAttr(mPlayerIdx, (int)Const_Util.UNIT_ATTR.MOVE_CUR_SPEED);
        float   carSpeedY = carSpeed.y;

        if (carSpeedY < TestConfig.EfxSpeedBaseOnCar)
        {
            carSpeedY = TestConfig.EfxSpeedBaseOnCar;
        }

        Vector3 moveSpeed = new Vector3(skill.efx_velocity.x, skill.efx_velocity.y + carSpeedY, 0.0f);

        // check move to left or right
        if (worldPos.x > 0)
        {
            item.speed = new Vector3(-moveSpeed.x, moveSpeed.y, moveSpeed.z);
        }
        else
        {
            item.speed = moveSpeed;
        }

        return(item);
    }
Esempio n. 17
0
        public ActionResult UpdateSkill(SKILL s)
        {
            var x = c.SKILLS.Find(s.ID);

            x.ACIKLAMA = s.ACIKLAMA;
            x.DEGER    = s.DEGER;
            c.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 18
0
        public void OnSkill(SKILL skillIndex)
        {
            SelectSkill(skillIndex);

            if (null != mSelectSkill)
            {
                mSelectSkill.LaunchSkill();
            }
        }
 public void setCurLevel(SKILL skill, int lvl)
 {
     int i_skill = Convert.ToInt32(skill);
     curLevel[i_skill] = lvl;
     if (curLevel[i_skill] <= 0)
         curLevel[i_skill] = 0;
     else if (curLevel[i_skill] > maxLevel[i_skill])
         curLevel[i_skill] = maxLevel[i_skill];
 }
Esempio n. 20
0
    string GetEfxResPath()
    {
        SKILL skill = DataCfgMgr.instance.GetSkill(mSkillID);

        if (skill == null)
        {
            return("");
        }
        return(skill.respath);
    }
Esempio n. 21
0
    public void ShowRandomSkillName()
    {
        SKILL skillItem = DataCfgMgr.instance.GetSkill(randomSKillID);

        if (skillItem != null && randomSKillID != 0)
        {
            showSkillIDCom.text     = skillItem.name;
            skillBtnCG.interactable = true;
        }
    }
Esempio n. 22
0
 public ActionResult Edit([Bind(Include = "Skill_ID,Skill_Name")] SKILL sKILL)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sKILL).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sKILL));
 }
Esempio n. 23
0
        public ActionResult Create([Bind(Include = "Skill_ID,Skill_Name")] SKILL sKILL)
        {
            if (ModelState.IsValid)
            {
                db.SKILL.Add(sKILL);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sKILL));
        }
Esempio n. 24
0
 // Update is called once per frame
 void Update()
 {
     if (next_skill_to_begin != null) //UI里已经判断过是否可以使用 这技能是一定可以使用的
     {
         Debug.Log("next_skill_to_begin!=null");
         current_skill = next_skill_to_begin;
         //更新人物状态:BEGIN_SKILL
         Debug.Log("changeState(PEOPLE.BEGIN_SKILL)");
         changeState(PEOPLE.BEGIN_SKILL);
         next_skill_to_begin = null;
     }
 }
Esempio n. 25
0
        public float GetSkillColdTime(SKILL skillIndex)
        {
            SelectSkill(skillIndex);

            if (null != mSelectSkill)
            {
                return(mSelectSkill.GetColdTime());
            }
            else
            {
                return(1f);
            }
        }
Esempio n. 26
0
        public SKILL UpdateSkill(int userid, int skillid, SKILL nowSkill)
        {
            List <SKILL> skills = UserIdToskill[userid];

            for (int i = 0; i < skills.Count; i++)
            {
                if (skills[i].Id == skillid)
                {
                    skills[i] = nowSkill;
                }
            }
            return(nowSkill);
        }
Esempio n. 27
0
        public bool AddSkill(SKILL skill, int idPer)
        {
            int  countRecords = 0;
            USER userEntity   = context.USERs.Find(idPer);

            if (userEntity != null && skill != null)
            {
                userEntity.SKILLS.Add(skill);
                countRecords = context.SaveChanges();
            }

            return(countRecords > 0 ? true : false);
        }
Esempio n. 28
0
    void Start()
    {
        // 캐릭터 생성 시 ID
        if (PhotonNetwork.isMasterClient)
        {
            if (photonView.isMine)
            {
                id = 1;
                transform.position = new Vector3(-7, 0, -1);
            }
            else
            {
                id = 2;
                transform.position = new Vector3(7, 0, -1);

                transform.rotation = Quaternion.Euler(Vector3.up * 180);
            }
        }
        else
        {
            if (photonView.isMine)
            {
                id = 2;
                transform.position = new Vector3(7, 0, -1);

                transform.rotation = Quaternion.Euler(Vector3.up * 180);
            }
            else
            {
                id = 1;
                transform.position = new Vector3(-7, 0, -1);
            }
        }

        if (skill)
        {
            skill = GetComponent <SKILL>();
        }

        if (id == 2 && NetworkManager.Instance.isPlay)
        {
            arm[0].transform.parent.position = new Vector3(arm[0].transform.parent.position.x, arm[0].transform.parent.position.y, 0);
        }

        if (PhotonNetwork.isMasterClient && NetworkManager.Instance.isPlay)
        {
            StartCoroutine(CorSpawnStone());
        }

        //Cursor.lockState = CursorLockMode.Confined
    }
Esempio n. 29
0
        public bool Delete(int?Id)
        {
            SKILL entity = GetById(Id);

            if (entity != null)
            {
                db.SKILLs.Remove(entity);
                if (db.SaveChanges() > 0)
                {
                    return(true);
                }
            }
            return(false);
        }
        public void setCurLevel(SKILL skill, int lvl)
        {
            int i_skill = Convert.ToInt32(skill);

            curLevel[i_skill] = lvl;
            if (curLevel[i_skill] <= 0)
            {
                curLevel[i_skill] = 0;
            }
            else if (curLevel[i_skill] > maxLevel[i_skill])
            {
                curLevel[i_skill] = maxLevel[i_skill];
            }
        }
Esempio n. 31
0
        // GET: SKILLs/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SKILL sKILL = db.SKILL.Find(id);

            if (sKILL == null)
            {
                return(HttpNotFound());
            }
            return(View(sKILL));
        }
Esempio n. 32
0
	// 
	public cSkillData( SKILL skl )
	{
		skill = skl;
		if (skill == null)
			return; 
		// fill data
		UseCond = MyScript.Instance.CreateEffectCondition ( skill.s_CONDITION );

		CastPool = MyScript.Instance.CreateEffectPool ( skill.s_CAST );
		CastCond = MyScript.Instance.CreateEffectCondition ( skill.s_CAST_TRIG);
		CastCondEffectPool  = MyScript.Instance.CreateEffectPool ( skill.s_CAST_EFFECT );

		HitPool = MyScript.Instance.CreateEffectPool ( skill.s_HIT );
		HitCond = MyScript.Instance.CreateEffectCondition ( skill.s_HIT_TRIG );
		HitCondEffectPool = MyScript.Instance.CreateEffectPool ( skill.s_HIT_EFFECT );

		foreach (cEffect eft in CastPool) {
			eft.SetBaseParam( nID ,  0 ); // skill id 
		}
		foreach (cEffect eft in CastCondEffectPool) {
			eft.SetBaseParam( nID ,  0 ); // skill id 
		}
		foreach (cEffect eft in HitPool) {
			eft.SetBaseParam( nID ,  0 ); // skill id 
		}
		foreach (cEffect eft in HitCondEffectPool) {
			eft.SetBaseParam( nID ,  0 ); // skill id 
		}

		// Set TAG 
		string[] tags = skill.s_TAG.Split ( ";".ToCharArray() );
		foreach (string s in tags) {
			int tag =0;
			if( int.TryParse( s , out tag ) ){ 
				AddTag( ( _SKILLTAG)tag );
			}

		}


	}
Esempio n. 33
0
 public int getLevelForXp(SKILL skill)
 {
     double exp = xp[Convert.ToInt32(skill)];
     int points = 0;
     int output = 0;
     for (int lvl = 1; lvl < 100; lvl++)
     {
         points += (int)Math.Floor((double)lvl + 300.0 * Math.Pow(2.0, (double)lvl / 7.0));
         output = (int)Math.Floor((double)points / 4);
         if ((output - 1) >= exp)
         {
             return lvl;
         }
     }
     return 99;
 }
Esempio n. 34
0
	void SetSkill( SKILL skl )
	{
		SkillSprite.SetActive ( (skl != null) );
		if (skl == null) {

			return;
		}
		MyTool.SetLabelText (SkillContent, skl.s_NAME);
		nOpSkillID = skl.n_ID;

	//	CastNote.SetActive (true);
	}
 public void setMaxLevel(SKILL skill, int lvl)
 {
     maxLevel[Convert.ToInt32(skill)] = lvl;
 }
 public int getGreaterLevel(SKILL skill)
 {
     return Math.Max(curLevel[Convert.ToInt32(skill)], maxLevel[Convert.ToInt32(skill)]);
 }
 public int getMaxLevel(SKILL skill)
 {
     return maxLevel[Convert.ToInt32(skill)];
 }
 public int getCurLevel(SKILL skill)
 {
     return curLevel[Convert.ToInt32(skill)];
 }
Esempio n. 39
0
 public void addXp(SKILL skill, double exp)
 {
     int skillIndex = Convert.ToInt32(skill);
     int oldLevel = getLevelForXp(skill);
     xp[skillIndex] += exp;
     if (xp[skillIndex] >= MAXIMUM_EXP)
     {
         xp[skillIndex] = MAXIMUM_EXP;
     }
     int newLevel = getLevelForXp(skill);
     if(newLevel > oldLevel && newLevel <= 99) {
         if (skillIndex != 3)
         {
             curLevel[skillIndex] = newLevel;
             maxLevel[skillIndex] = newLevel;
         } else {
             curLevel[3]++;
             maxLevel[3]++;
         }
         levelUp(player, skill);
     }
     player.getPackets().sendSkillLevel(skill);
 }
Esempio n. 40
0
 public double getXp(SKILL skill)
 {
     return xp[Convert.ToInt32(skill)];
 }
Esempio n. 41
0
        public void setCurLevel(SKILL skill, int lvl)
        {
            int i_skill = Convert.ToInt32(skill);

            curLevel[i_skill] = lvl;
            //Hitpoints and prayer are the only two skills which can hit 0.
            if (curLevel[i_skill] <= 0) {
                if (skill == SKILL.HITPOINTS || skill == SKILL.PRAYER)
                    curLevel[i_skill] = 0;
                else
                    curLevel[i_skill] = 1;
            }
            if (skill == SKILL.PRAYER)
            {
                if (curLevel[i_skill] <= 0 || lvl == 0)
                {
                    curLevel[i_skill] = 0;
                    player.getPackets().sendMessage("You have run out of Prayer points, please recharge your prayer at an altar.");
                    Prayer.deactivateAllPrayers(player);
                }
            }
        }
Esempio n. 42
0
 public void setXp(SKILL skill, int newXp)
 {
     xp[Convert.ToInt32(skill)] = newXp;
     maxLevel[Convert.ToInt32(skill)] = getLevelForXp(skill);
 }
Esempio n. 43
0
        public static void levelUp(Player player, SKILL skill)
        {
            int skillIndex = Convert.ToInt32(skill);
            String s = "<br><br><br>";
            String s1 = "<br><br><br><br>";
            if (player.getTemporaryAttribute("teleporting") == null)
            {
                player.setLastGraphics(new Graphics(199, 0, 100));
            }

            int skillFlashFlags = (int)(player.getTemporaryAttribute("skillFlashFlags") == null ? 0 : (int)player.getTemporaryAttribute("skillFlashFlags"));
            skillFlashFlags |= SKILL_FLASH_BITMASKS[skillIndex];
            player.setTemporaryAttribute("skillFlashFlags", skillFlashFlags);

            player.getPackets().sendMessage("You've just advanced a " + SKILL_NAME[skillIndex] + " level! You have reached level " + player.getSkills().getMaxLevel(skillIndex) + ".");
            player.getPackets().modifyText(s + "Congratulations, you have just advanced a " + SKILL_NAME[skillIndex] + " level!", 740, 0);
            player.getPackets().modifyText(s1 + "You have now reached level " + player.getSkills().getMaxLevel(skillIndex) + ".", 740, 1);
            player.getPackets().modifyText("", 740, 2);
            player.getPackets().sendConfig(1179, SKILL_ICON_BITMASKS[skillIndex] | skillFlashFlags); //start flashing appropriate skill icons
            player.getPackets().sendChatboxInterface2(740);
            player.getUpdateFlags().setAppearanceUpdateRequired(true);
        }