示例#1
0
	private void SkillDelegatorCooltime( Tbl_Skill_Record skillRecord )
	{
		switch(skillRecord.Command_Type)
		{
		case eCommand_Type.ArcCW: 
			BeginCommandSkillCoolDown(COMMAND_SKILL_TYPE._ARC_CW); 
			break;
		case eCommand_Type.ArcCCW: 
			BeginCommandSkillCoolDown(COMMAND_SKILL_TYPE._ARC_CCW); 
			break;
		case eCommand_Type.Straight: 
			BeginCommandSkillCoolDown(COMMAND_SKILL_TYPE._STRAIGHT); 
			break;
		case eCommand_Type.CircleCW: 
			BeginCommandSkillCoolDown(COMMAND_SKILL_TYPE._CIRCLE_CW); 
			break;
		case eCommand_Type.CircleCCW: 
			BeginCommandSkillCoolDown(COMMAND_SKILL_TYPE._CIRCLE_CCW); 
			break;
		case eCommand_Type.DoubleTab:
			{
				switch( skillRecord.CommandPicking_Type)
				{
				case eCommandPicking_Type.FingerPoint:
					BeginCommandSkillCoolDown( COMMAND_SKILL_TYPE._DOUBLE_TAP_MONSTER);
					break;
				case eCommandPicking_Type.Self:
					BeginCommandSkillCoolDown( COMMAND_SKILL_TYPE._DOUBLE_TAP_PLAYER);
					break;
				}
			}
			break;
		}
	}
示例#2
0
	public void SkillSelection( Tbl_Skill_Record skillRecord, int _id, int _level)
	{
		id = _id;
		level = _level;

		StringBuilder sb = new StringBuilder();
		sb.AppendFormat( AsTableManager.Instance.GetTbl_String(72), AsTableManager.Instance.GetTbl_String( skillRecord.SkillName_Index), _level);

		AsMessageBox msgBox = AsNotify.Instance.MessageBox( AsTableManager.Instance.GetTbl_String(353), sb.ToString(),
			this, "SkillLearn", AsNotify.MSG_BOX_TYPE.MBT_OKCANCEL, AsNotify.MSG_BOX_ICON.MBI_QUESTION);
		msgBox.SetOkText( AsTableManager.Instance.GetTbl_String(1152));
		msgBox.SetCancelText( AsTableManager.Instance.GetTbl_String(1151));
	}
示例#3
0
	public void Init( Tbl_Skill_Record skillRecord, Tbl_SkillLevel_Record skillLevelRecord)
	{
		if(goIcon != null)
			Destroy(goIcon);

		if(col == null)
		{
			Debug.LogError("UIPetSkillTooltip:: Init: icon position is not set");
			return;
		}

		GameObject obj = Resources.Load( skillRecord.Skill_Icon) as GameObject;
		if( null == obj )
		{
			Debug.LogError("UIPetSkillTooltip:: Init: invalid path. skillRecord.Skill_Icon = " + skillRecord.Skill_Icon);
			return;
		}

		goIcon = GameObject.Instantiate( obj) as GameObject;
		goIcon.transform.parent = col.transform;
		goIcon.transform.localPosition = new Vector3( 0.0f, 0.0f, -0.5f);
		goIcon.transform.localRotation = Quaternion.identity;
		goIcon.transform.localScale = Vector3.one;

		UISlotItem slotItem = goIcon.GetComponent<UISlotItem>();
		if(slotItem != null)
			slotItem.iconImg.SetSize( col.size.x, col.size.y);
		
		string szDesc = AsTableManager.Instance.GetTbl_String( skillRecord.Description_Index);
		szDesc = AsUtil.ModifyDescriptionInTooltip( szDesc, skillRecord.Index, skillLevelRecord.Skill_Level, 0);
		desc.Text = szDesc;

		gameObject.SetActive(true);

		StartCoroutine(WaitEnoughClose());
	}
示例#4
0
	public int GetSkillLevel(Tbl_Skill_Record _record)
	{
		if(m_dicCurSkill.ContainsKey(_record.Index) == true)
			return m_dicCurSkill[_record.Index].nSkillLevel;
		else
			return 1;
	}
示例#5
0
	public void Init( SkillView skill, bool isNew )
	{
		skillInfo = skill;
		
		if( eSkillPosition.SkillShop == position)
			slot.gameObject.collider.enabled = false;
		
		slot.SetSkillIcon( skill.nSkillTableIdx, skill.nSkillLevel);
		skillRecord = AsTableManager.Instance.GetTbl_Skill_Record( skill.nSkillTableIdx);
		if( null == skillRecord)
		{
			Debug.LogError( "null == skillRecord");
			return;
		}
		
		skillLevelRecord = AsTableManager.Instance.GetTbl_SkillLevel_Record( skill.nSkillLevel, skill.nSkillTableIdx);
		if( null == skillLevelRecord)
		{
			Debug.LogError( "null == skillLevelRecord");
			return;
		}

		UIListItem item = gameObject.GetComponent<UIListItem>();
		item.spriteText = desc;

		StringBuilder sb = new StringBuilder();
		
		switch( position)
		{
		case eSkillPosition.SkillShop:
			desc.transform.localPosition = new Vector3( 6.92458f, 1.524059f, -0.5f);
			desc.characterSize = 1;
			desc.anchor = SpriteText.Anchor_Pos.Upper_Right;
			desc.alignment = SpriteText.Alignment_Type.Right;

			AsUserEntity userEntity = AsUserInfo.Instance.GetCurrentUserEntity();
			int userLevel = userEntity.GetProperty<int>( eComponentProperty.LEVEL);
			string format = defaultColor.ToString() + "{0} Lv.{1}\n";
			if( userLevel < skillLevelRecord.Level_Limit)
				format += deficientColor.ToString();
			format += AsTableManager.Instance.GetTbl_String(134) + " {2}\n";
			
			if( ( true == AsUserInfo.Instance.resettedSkills.ContainsKey( skill.getSkillRecord.Index))
				|| ( true == AsUserInfo.Instance.resettedSkills.ContainsKey( skill.getSkillRecord.CoupleIndex)))
			{
				format += ( goldColor.ToString() + "0");
				
				sb.AppendFormat( format, AsTableManager.Instance.GetTbl_String( skillRecord.SkillName_Index),
					skill.nSkillLevel, skillLevelRecord.Level_Limit);
			}
			else
			{
				if( AsUserInfo.Instance.SavedCharStat.nGold < (ulong)price)
					format += ( deficientColor.ToString() + "{3}");
				else
					format += ( goldColor.ToString() + "{3}");
	
				sb.AppendFormat( format, AsTableManager.Instance.GetTbl_String( skillRecord.SkillName_Index),
					skill.nSkillLevel, skillLevelRecord.Level_Limit, price.ToString( "#,#0", CultureInfo.InvariantCulture));
			}
			break;
			
		case eSkillPosition.SkillBook:
			
			//	skill reset cost button
			Vector3	descPos;
			if( skillRecord.SkillReset == eSkillReset.Enable && skillRecord.SkillResetCost >= 0 )
			{
				btnReset.gameObject.SetActive(true);
				btnReset.SetInputDelegate(ResetBtnDelegate);
				btnResetUp.SetInputDelegate(ResetBtnDelegate);
				textResetDesc.Text = AsTableManager.Instance.GetTbl_String(1221);
				textResetCost.Text = skillRecord.SkillResetCost.ToString();
			}
			else
			{
				btnReset.gameObject.SetActive(false);
			}
			
			descPos = new Vector3( -4.641596f , 0.0f, -0.5f);
			desc.transform.localPosition = descPos;
			desc.characterSize = 2;
			desc.anchor = SpriteText.Anchor_Pos.Middle_Left;
			
			desc.alignment = SpriteText.Alignment_Type.Center;

			sb.AppendFormat( "{0} Lv.{1}", AsTableManager.Instance.GetTbl_String( skillRecord.SkillName_Index), skill.nSkillLevel);
			break;
		}

		desc.Text = sb.ToString();
		
		UISlotItem slotItem = slot.getIcon.GetComponent<UISlotItem>();
		if( null == slotItem)
		{
			Debug.LogError( "null == slotItem");
			return;
		}
		GameObject.DestroyImmediate( slotItem.coolTime.gameObject);
		GameObject.DestroyImmediate( slotItem.itemCountText.gameObject);
		slotItem.iconImg.renderer.enabled = false;
		item.layers[0] = slotItem.iconImg;
		
		if( isNew )
		{			
			GameObject obj = ResourceLoad.CreateUI( "UI/AsGUI/GUI_NewImg", slotItem.iconImg.transform, new Vector3(0f, 1f, -0.1f ) );
			if( null == obj )
				return;
			SimpleSprite _sprite = obj.GetComponentInChildren<SimpleSprite>();
			if( null!= _sprite )
				item.layers[2] = _sprite;
		}
	}
示例#6
0
	public Msg_Player_Skill_Ready( int _skillIdx, int _skillLv, eGENDER _gender)
	{
		m_MessageType = eMessageType.PLAYER_SKILL_READY;

		head_ = Vector3.zero;
		center_ = Vector3.zero;
		tail_ = Vector3.zero;

		direction_ = Vector3.zero;

		skillRecord_ = AsTableManager.Instance.GetTbl_Skill_Record( _skillIdx);
		skillLvRecord_ = AsTableManager.Instance.GetTbl_SkillLevel_Record( _skillLv, _skillIdx);

		int actionIdx = -1;
		if( _gender == eGENDER.eGENDER_MALE)
			actionIdx = skillLvRecord_.SkillAction_Index;
		else if( _gender == eGENDER.eGENDER_FEMALE)
			actionIdx = skillLvRecord_.SkillAction_Index_Female;

		actionRecord_ = AsTableManager.Instance.GetTbl_Action_Record( actionIdx);

		constructSucceed_ = true;
	}
示例#7
0
	void SetSkillData(Tbl_Skill_Record _record)
	{
		if(_record != null && _record.SkillName_Index != int.MaxValue)
		{
			m_SkillName = AsTableManager.Instance.GetTbl_String(_record.SkillName_Index);
			m_SkillNamePrint = _record.SkillName_Print;
		}
		else
			Debug.LogWarning("BuffElement::SetSkillData: there is no [" + _record.Index + "] skill record's skill name.");
	}
示例#8
0
	public static bool CheckDisableSkillByCondition(AsPlayerFsm _player, Tbl_Skill_Record _record) // for auto combat
	{
		bool movable = _record.CheckSkillUsingOnly_Movable();
		
		if( false == _player.Entity.CheckCondition( eSkillIcon_Enable_Condition.Movable) &&
			true == movable)
		{
			AsMyProperty.Instance.AlertState();
			return false;
		}

		if( true == _player.Entity.CheckCondition( eSkillIcon_Enable_Condition.Stun) ||
			true == _player.Entity.CheckCondition( eSkillIcon_Enable_Condition.Freeze) ||
			true == _player.Entity.CheckCondition( eSkillIcon_Enable_Condition.Sleep) ||
			true == _player.Entity.CheckCondition( eSkillIcon_Enable_Condition.Fear))
		{
			AsMyProperty.Instance.AlertState();			
			return false;
		}
		
		return true;
	}
示例#9
0
	static bool SkillTargetTypeCheck( Tbl_Skill_Record skillRecord, AsPlayerFsm fsm)
	{
		switch( skillRecord.SkillIcon_Enable_Target)
		{
		case eSkillIcon_Enable_Target.Self:
			return SkillTargetStateCheck( skillRecord, fsm.UserEntity);
		case eSkillIcon_Enable_Target.Target:
			return SkillTargetStateCheck( skillRecord, fsm.Target);
		}
		
		return true;
	}
示例#10
0
	public static bool CheckValidSkill(AsPlayerFsm _playerFsm, Tbl_Skill_Record _record)// use targetting slot only 
	{
		if( ( _record.Skill_Type == eSKILL_TYPE.Target) || ( _record.Skill_Type == eSKILL_TYPE.SlotBase))
		{
			if( null == _playerFsm.Target)
			{
				if( true == _playerFsm.CheckMap_Village())
					AsMyProperty.Instance.AlertSkillInTown();
				else
					AsMyProperty.Instance.AlertInvalidTarget();
				return false;
			}
			else
				return true;
		}

		return true;
	}
示例#11
0
	public Msg_OtherCharAttackNpc1( Msg_OtherCharSkillStance _stance)
	{
		sessionId_ = _stance.sessionIdx_;
		charUniqKey_ = _stance.charUniqKey_;
		
		npcIdx_ = new int[TargetDecider.MAX_SKILL_TARGET];
		mainCharUniqKey_ = new uint[TargetDecider.MAX_SKILL_TARGET];
		
		skillTableIdx_ = _stance.stanceSkill_;
		skillLevel_ = _stance.stanceLevel_;
		
		ready_ = true;
		
		skillLv_ = AsTableManager.Instance.GetTbl_SkillLevel_Record( skillLevel_, skillTableIdx_);
		skill_ = AsTableManager.Instance.GetTbl_Skill_Record( skillLv_.Skill_GroupIndex);
		action_ = AsTableManager.Instance.GetTbl_Action_Record( skillLv_.SkillAction_Index);
		
		actionTableIdx_ = action_.Index;
	}
示例#12
0
//	public bool instantSkill_;

//	public Msg_OtherCharAttackNpc1( AS_SC_CHAR_ATTACK_NPC_1 _info)
//	{
//		Msg_OtherCharAttackNpc1( _info, false);
//	}

//	public Msg_OtherCharAttackNpc1( AS_SC_CHAR_ATTACK_NPC_1 _info, bool _instantSkill)
	public Msg_OtherCharAttackNpc1( AS_SC_CHAR_ATTACK_NPC_1 _info)
	{
		m_MessageType = eMessageType.CHAR_ATTACK_NPC1;

		sessionId_ = _info.nSessionIdx;
		charUniqKey_ = _info.nCharUniqKey;

		npcIdx_ = _info.nNpcIdx;
		mainCharUniqKey_ = _info.nMainCharUniqKey;
		targeting_ = _info.sTargeting;
		direction_ = _info.sDirection;

		skillTableIdx_ = _info.nSkillTableIdx;
		skillLevel_ = _info.nSkillLevel;
		actionTableIdx_ = _info.nActionTableIdx;
		chargeStep_ = _info.nChargeStep;
		casting_ = _info.bCasting;
		ready_ = _info.bReady;

		hpCur_ = _info.nHpCur;
		hpHeal_ = _info.nHpHeal;

		if( _info.nChargeStep == 0)
			skillLv_ = AsTableManager.Instance.GetTbl_SkillLevel_Record( _info.nSkillLevel, _info.nSkillTableIdx);
		else
			skillLv_ = AsTableManager.Instance.GetTbl_SkillLevel_Record( _info.nSkillLevel, _info.nSkillTableIdx, _info.nChargeStep);

		attacker_ = AsEntityManager.Instance.GetUserEntityByUniqueId( charUniqKey_);
		skill_ = AsTableManager.Instance.GetTbl_Skill_Record( skillLv_.Skill_GroupIndex);
		action_ = AsTableManager.Instance.GetTbl_Action_Record( skillLv_.SkillAction_Index);

		npcCnt_ = _info.nNpcCnt;
		charCnt_ = _info.nCharCnt;

		bool IsMine = AsUserInfo.Instance.GetCurrentUserEntity().UniqueId == charUniqKey_ ? true : false;

		foreach( AS_SC_CHAR_ATTACK_NPC_2 attack2 in _info.bodyNpc)
		{
			npcBody_.Add( new Msg_OtherCharAttackNpc2( this, attack2, charUniqKey_));
		}

		foreach( AS_SC_CHAR_ATTACK_NPC_3 attack3 in _info.bodyChar)
		{
			charBody_.Add( new Msg_OtherCharAttackNpc3( this, attack3));
		}

		if( ready_ == false)
		{
			if( IsMine == true)
				QuestMessageBroadCaster.BrocastQuest( QuestMessages.QM_USE_SKILL, new AchUseSkill( _info.nSkillTableIdx, 1));

			int count = 0;
			foreach ( AS_SC_CHAR_ATTACK_NPC_2 attack2 in _info.bodyNpc)
			{
				AsNpcEntity monEntity = AsEntityManager.Instance.GetNpcEntityBySessionId( attack2.nNpcIdx);

				if( monEntity != null)
				{
					if( IsMine == true)
					{
						int monId = monEntity.GetProperty<int>( eComponentProperty.MONSTER_ID);
						int monKindID = monEntity.GetProperty<int>( eComponentProperty.MONSTER_KIND_ID);
						QuestMessageBroadCaster.BrocastQuest( QuestMessages.QM_USE_SKILL_TO_MONSTER, new AchUseSkillToMonster( _info.nSkillTableIdx, monId, 1));
						QuestMessageBroadCaster.BrocastQuest( QuestMessages.QM_USE_SKILL_TO_MONSTER_KIND, new AchUseSkillToMonsterKind( _info.nSkillTableIdx, monKindID, 1));
					}
				}
				else
					Debug.LogWarning( "MonsterEntity is null " + count);

				count++;
			}
		}
	}
示例#13
0
	public Msg_Pet_Skill_Ready( sPETSKILL _petSkill)
	{
		m_MessageType = eMessageType.PET_SKILL_READY;
		
		playerPet_ = true;
		
		skillRecord_ = AsTableManager.Instance.GetTbl_Skill_Record( _petSkill.nSkillTableIdx);
		skillLvRecord_ = AsTableManager.Instance.GetTbl_SkillLevel_Record( _petSkill.nLevel, _petSkill.nSkillTableIdx);
		actionRecord_ = AsTableManager.Instance.GetPetActionRecord( skillLvRecord_.SkillAction_Index);
	}
示例#14
0
	public Msg_Pet_Skill_Ready( body_SC_PET_SKILL_USE _use)
	{
		m_MessageType = eMessageType.PET_SKILL_READY;
		
		playerPet_ = false;
		
		skillRecord_ = AsTableManager.Instance.GetTbl_Skill_Record( _use.nSkillTableIdx);
		skillLvRecord_ = AsTableManager.Instance.GetTbl_SkillLevel_Record( _use.nSkillLevel, _use.nSkillTableIdx);
		actionRecord_ = AsTableManager.Instance.GetPetActionRecord( skillLvRecord_.SkillAction_Index);
	}
示例#15
0
	public void SetSkillLevel( Tbl_Skill_Record _record)
	{
		skillLv_ = SkillBook.Instance.GetSkillLevel( _record);
	}
示例#16
0
	public Msg_Player_Skill_Ready( ItemData _data, int _slot, eGENDER _gender)
	{
		m_MessageType = eMessageType.PLAYER_SKILL_READY;

		head_ = Vector3.zero;
		center_ = Vector3.zero;
		tail_ = Vector3.zero;

		direction_ = Vector3.zero;

		skillRecord_ = AsTableManager.Instance.GetTbl_Skill_Record( _data.itemSkill);

		skillLv_ = _data.itemSkillLevel;
		skillLvRecord_ = AsTableManager.Instance.GetTbl_SkillLevel_Record( skillLv_, _data.itemSkill);

		int actionIdx = -1;
		if( _gender == eGENDER.eGENDER_MALE)
			actionIdx = skillLvRecord_.SkillAction_Index;
		else if( _gender == eGENDER.eGENDER_FEMALE)
			actionIdx = skillLvRecord_.SkillAction_Index_Female;

		actionRecord_ = AsTableManager.Instance.GetTbl_Action_Record( actionIdx);

		if( actionRecord_.HitAnimation != null &&
			actionRecord_.HitAnimation.FileName == "NonAnimation")
			constructSucceed_ = false;
		else
			constructSucceed_ = true;

		itemSlot_ = _slot;
	}
示例#17
0
	public void SetTooltip(Tbl_Skill_Record _skill, Tbl_SkillLevel_Record _skillLv)
	{
		tooltip.Init(_skill, _skillLv);
	}
示例#18
0
	void BalloonProcess( Tbl_Skill_Record _skill, Tbl_SkillLevel_Record _skillLv)
	{
		List<Tbl_SkillLevel_Potency> list = new List<Tbl_SkillLevel_Potency>();
		
		for(int i=0; i<_skill.listSkillPotency.Count; ++i)
		{
			Tbl_Skill_Potency potency = _skill.listSkillPotency[i];
			Tbl_SkillLevel_Potency lvPotency = _skillLv.listSkillLevelPotency[i];
			
			if(potency.Potency_Type == ePotency_Type.Balloon)
				list.Add( lvPotency);
		}
		
		if( list.Count > 0)
			m_Owner.HandleMessage( new Msg_BalloonIndicate( list[ Random.Range( 0, list.Count)]));
	}
示例#19
0
	public Msg_OtherCharAttackNpc_Ready( Msg_OtherCharAttackNpc1 _msg)//, float _animSpeed)
	{
		try
		{
			m_MessageType = eMessageType.OTHER_CHAR_ATTACK_READY;

			attack_ = _msg;

			skill_ = AsTableManager.Instance.GetTbl_Skill_Record( attack_.skillTableIdx_);
			skillLv_ = AsTableManager.Instance.GetTbl_SkillLevel_Record( 
				attack_.skillLevel_, attack_.skillTableIdx_, attack_.chargeStep_);
			action_ = AsTableManager.Instance.GetTbl_Action_Record( _msg.actionTableIdx_);

			animSpeed_ = 1f;

			if( animSpeed_ == 0f)
			{
				Debug.LogError( "Msg_OtherCharAttackNpc_Ready::constructor: animSpeed_ is set as 0. instead set animSpeed_ 1f");
				animSpeed_ = 1f;
			}
		}
		catch
		{
			Debug.Log( "Msg_OtherCharAttackNpc_Ready:constructor: error occured");
		}
	}
示例#20
0
	public static bool SkillTargetStateCheck( Tbl_Skill_Record skillRecord, AsBaseEntity entity, bool _showAlert = true)
	{
		bool ret = false;
		
		switch( skillRecord.SkillIcon_Enable_Condition)
		{
		case eSkillIcon_Enable_Condition.NONE:
			return true;
		case eSkillIcon_Enable_Condition.LowHealth:
			if(entity.ContainProperty(eComponentProperty.HP_CUR) == true)
			{
				float curHP = entity.GetProperty<float>( eComponentProperty.HP_CUR);
				if( curHP < skillRecord.SkillIcon_Enable_ConditionValue)
					ret = true;
			}
			break;
		case eSkillIcon_Enable_Condition.Death:
			if(entity.ContainProperty(eComponentProperty.LIVING) == true)
			{
				bool isDied = entity.GetProperty<bool>( eComponentProperty.LIVING);
				ret = !isDied;
			}
			break;
		case eSkillIcon_Enable_Condition.Movable:
			AsUserEntity player = AsUserInfo.Instance.GetCurrentUserEntity();
			ret = player.CheckCondition( eSkillIcon_Enable_Condition.Movable) &&
				player.GetProperty<bool>(eComponentProperty.LIVING);
			break;
		default:
			ret = entity.CheckCondition( skillRecord.SkillIcon_Enable_Condition);
			break;
		}
		
		if( false == ret && _showAlert == true)
			AsMyProperty.Instance.AlertState();
		
		return ret;
	}
示例#21
0
	//constructor
	public Msg_Player_Skill_Ready( eCLASS _class, eSKILL_TYPE _type, eCommand_Type _command, eGENDER _gender,
		AsBaseEntity _pickedEntity, Vector3 _picked,
		Vector3 _head, Vector3 _center, Vector3 _tail,
		Vector3 _dir, eClockWise _cw)
	{
		m_MessageType = eMessageType.PLAYER_SKILL_READY;

		pickedEntity_ = _pickedEntity;
		picked_ = _picked;

		head_ = _head;
		center_ = _center;
		tail_ = _tail;

		direction_ = _dir;

		cw_ = _cw;

		switch( _type)
		{
		case eSKILL_TYPE.Base:
			skillRecord_ = AsTableManager.Instance.GetRandomBaseSkill( _class);
			break;
		case eSKILL_TYPE.Command:
			skillRecord_ = SkillBook.Instance.GetLearnedCommandSkill( _command);
			break;
		default:
			Debug.LogError( "Msg_Player_Skill_Ready::Msg_Player_Skill_Ready(): [class]" + _class + ",[type]" +
				_type + ",[command]" + _command +
				",[head_]" + _head + ",[center_]" + _center + ",[tail_]" + _tail + ",[direction]" + direction_);
			break;
		}

		if( skillRecord_ != null)
		{
			skillLv_ = SkillBook.Instance.GetSkillLevel( skillRecord_);

			skillLvRecord_ = AsTableManager.Instance.GetTbl_SkillLevel_Record( skillLv_, skillRecord_.Index);

			int actionIdx = -1;
			if( _gender == eGENDER.eGENDER_MALE)
			{
				if( cw_ == eClockWise.CW)
					actionIdx = skillLvRecord_.SkillAction_Index;
				else
					actionIdx = skillLvRecord_.SkillActionCCW_Index;
			}
			else if( _gender == eGENDER.eGENDER_FEMALE)
			{
				if( cw_ == eClockWise.CW)
					actionIdx = skillLvRecord_.SkillAction_Index_Female;
				else
					actionIdx = skillLvRecord_.SkillActionCCW_Index_Female;
			}

			actionRecord_ = AsTableManager.Instance.GetTbl_Action_Record( actionIdx);

			if( skillLvRecord_ != null || actionRecord_ != null)
			{
				constructSucceed_ = true;
				return;
			}
		}
	}
示例#22
0
	public static bool CheckDisableSkillByMap(Tbl_Skill_Record _skillrecord)
	{
		if( null != _skillrecord)
		{
			if(CheckCurrentMapIsArena() == true && _skillrecord.DisableInPvP == eDisableInPvP.Disable)
			{
				AsMyProperty.Instance.AlertNotInPvp();
				return true;
			}
			if(CheckCurrentMapIsRaid() == true && _skillrecord.DisableInRaid == eDisableInRaid.Disable)
			{
				AsMyProperty.Instance.AlertNotInRaid();
				return true;
			}
			if(CheckCurrentMapIsField() == true && _skillrecord.DisableInField == eDisableInRaid.Disable)
			{
				AsMyProperty.Instance.AlertNotInField();
				return true;
			}
			if( CheckCurrentMapIsIndun() == true && _skillrecord.DisableInInDun == eDisableInInDun.Disable)
			{
				AsMyProperty.Instance.AlertNotInIndun();
				return true;
			}
		}
		
		return false;
	}
示例#23
0
	public Msg_Player_Skill_Ready( Tbl_Skill_Record _record, eGENDER _gender, int _step/* = 1 */,
		AsBaseEntity _pickedEntity, Vector3 _picked,
		Vector3 _head, Vector3 _center, Vector3 _tail, Vector3 _dir, eClockWise _cw)
	{
		m_MessageType = eMessageType.PLAYER_SKILL_READY;

		pickedEntity_ = _pickedEntity;
		picked_ = _picked;

		head_ = _head;
		center_ = _center;
		tail_ = _tail;

		direction_ = _dir;

		skillRecord_ = _record;
		if( skillRecord_ != null)
		{
			skillLv_ = SkillBook.Instance.GetSkillLevel( skillRecord_);

			skillLvRecord_ = AsTableManager.Instance.GetTbl_SkillLevel_Record( skillLv_, skillRecord_.Index, _step);

			int actionIdx = -1;
			if( _gender == eGENDER.eGENDER_MALE)
			{
				if( cw_ == eClockWise.CW)
					actionIdx = skillLvRecord_.SkillAction_Index;
				else
					actionIdx = skillLvRecord_.SkillActionCCW_Index;
			}
			else if( _gender == eGENDER.eGENDER_FEMALE)
			{
				if( cw_ == eClockWise.CW)
					actionIdx = skillLvRecord_.SkillAction_Index_Female;
				else
					actionIdx = skillLvRecord_.SkillActionCCW_Index_Female;
			}

			actionRecord_ = AsTableManager.Instance.GetTbl_Action_Record( actionIdx);

			if( skillLvRecord_ != null || actionRecord_ != null)
			{
				constructSucceed_ = true;
				return;
			}
		}
	}
示例#24
0
	public static void sTargeting_AsSlot(AsPlayerFsm _playerFsm, Tbl_Skill_Record _skillRecord)// use targetting slot only 
	{
		if(_playerFsm.CheckMap_Village() == true)
			return;
		
		if( null == _playerFsm.Target) // no entity is targeted
		{
			if(_skillRecord.CheckPotencyTargetTypeIncludeEnemy() == true)
			{
				AsBaseEntity target = _playerFsm.HostileEntityExistInRange( AsTableManager.Instance.GetTbl_GlobalWeight_Record( 30).Value * 0.01f);
				_playerFsm.Target = target;
			}
		}
		else // taget is exist
		{
			if( _playerFsm.Target.FsmType == eFsmType.NPC || _playerFsm.Target.FsmType == eFsmType.COLLECTION)
			{
				if(_skillRecord.CheckPotencyTargetTypeIncludeEnemy() == true)
				{
					AsBaseEntity target = _playerFsm.MonsterExistInRange( AsTableManager.Instance.GetTbl_GlobalWeight_Record( 30).Value * 0.01f);
					if( target != null && target.CheckObjectMonster() == false)
						_playerFsm.Target = target;
				}
			}
			else if(_playerFsm.Target.FsmType == eFsmType.OTHER_USER)
			{
				if(CheckOtherUserIsEnemy(_playerFsm.Target) == false)
				{
					if( ( null != _skillRecord) && ( eSkillAutoTarget.Disable != _skillRecord.SkillAutoTarget))
					{
						if(_skillRecord.CheckPotencyTargetTypeIncludeEnemy() == true &&
							_skillRecord.CheckPotencyTypeIncludeHeal() == false)
						{
							AsUserEntity targetUser = _playerFsm.Target as AsUserEntity;
							AsBaseEntity targetUserTarget = targetUser.GetGetterTarget();
							if( targetUserTarget != null && targetUserTarget.FsmType == eFsmType.MONSTER)
								_playerFsm.Target = targetUserTarget;
							else
								_playerFsm.Target = _playerFsm.MonsterExistInRange( AsTableManager.Instance.GetTbl_GlobalWeight_Record( 30).Value * 0.01f);
						}
					}
				}
			}
			else if( _playerFsm.Target.FsmType == eFsmType.MONSTER)
			{
				if( _skillRecord.Skill_Type == eSKILL_TYPE.SlotBase && AsGameMain.GetOptionState(OptionBtnType.OptionBtnType_TargetChange) == true) // target already chose & slot base touched
				{
					float maxDist = AsTableManager.Instance.GetTbl_GlobalWeight_Record( 138).Value * 0.01f;
					float angle = AsTableManager.Instance.GetTbl_GlobalWeight_Record( 139).Value;
					List<AsBaseEntity> listEntities = AsEntityManager.Instance.GetHostileEntityInRange( _playerFsm.transform.position, 0.01f, maxDist);
					Debug.Log("TargetDecider::sTargeting_AsSlot: listEntities.Count = " + listEntities.Count);
					SortedDictionary<float, AsBaseEntity> angledEntities = GetEntityDicInAngleRanged( _playerFsm.transform.forward, _playerFsm.transform.position, angle, listEntities);
					Debug.Log("TargetDecider::sTargeting_AsSlot: angledEntities.Count = " + angledEntities.Count);
					
					foreach(KeyValuePair<float, AsBaseEntity> pair in angledEntities)
					{
						Debug.Log("TargetDecider::sTargeting_AsSlot: angledEntities angle = " + pair.Key);
					}
					
					int count = 0;
					AsBaseEntity selectedEntity = null;
					foreach(KeyValuePair<float, AsBaseEntity> pair in angledEntities)
					{
						if( _playerFsm.Target == pair.Value)
							continue;
						
						if( (count == 0 && pair.Key > 0) ||
							count > 0)
						{
							selectedEntity = pair.Value;
							break;
						}
						
						count++;
					}
					
					if( selectedEntity != null)
					{
						_playerFsm.Target = selectedEntity;
						AsMyProperty.Instance.AlertTargetChanged();
					}
				}
			}
		}
	}
示例#25
0
	public void Init( Tbl_Skill_Record skillRecord, Tbl_SkillLevel_Record skillLevelRecord, int price)
	{
		StringBuilder sb = new StringBuilder();
		
		this.skillRecord = skillRecord;
//		this.skillLevelRecord = skillLevelRecord;
		
		GameObject obj = Resources.Load( skillRecord.Skill_Icon) as GameObject;
		if( null == obj )
		{
			Debug.LogError("AsSkillTooltip::Init()");
			return;
		}
		
		goIcon = GameObject.Instantiate( obj) as GameObject;
		goIcon.transform.parent = icon.transform;
		goIcon.transform.localPosition = new Vector3( 0.0f, 0.0f, -0.5f);
		goIcon.transform.localRotation = Quaternion.identity;
		goIcon.transform.localScale = Vector3.one;
		
		if( eSKILL_TYPE.Passive == skillRecord.Skill_Type)
		{
			coolTimeText.gameObject.SetActiveRecursively( false);
			coolTime.gameObject.SetActiveRecursively( false);
			manaCostText.gameObject.SetActiveRecursively( false);
			manaCost.gameObject.SetActiveRecursively( false);
		}
		
		maxChargeStep = skillLevelRecord.ChargeMaxStep;
		if( int.MaxValue != maxChargeStep)
		{
			chargeStep.Text = curChargeStep.ToString();
			chargeStep.gameObject.SetActiveRecursively( true);
			chargeStepText.gameObject.SetActiveRecursively( true);
			prevBtn.gameObject.SetActiveRecursively( true);
			nextBtn.gameObject.SetActiveRecursively( true);
			skillLevelRecord = AsTableManager.Instance.GetTbl_SkillLevel_Record( level, id, curChargeStep);
		}
		else
		{
			chargeStep.gameObject.SetActiveRecursively( false);
			chargeStepText.gameObject.SetActiveRecursively( false);
			prevBtn.gameObject.SetActiveRecursively( false);
			nextBtn.gameObject.SetActiveRecursively( false);
		}
		
		string szDesc = AsTableManager.Instance.GetTbl_String( skillRecord.Description_Index);
		szDesc = AsUtil.ModifyDescriptionInTooltip( szDesc, id, level, curChargeStep);
		
		nameField.Text = AsTableManager.Instance.GetTbl_String( skillRecord.SkillName_Index);
		sb.Append ( "Lv.");
		sb.Append( level);
		lv.Text = sb.ToString();
//		lv.Text = "Lv." + level;
		desc.Text = szDesc;

		if( int.MaxValue == skillLevelRecord.CoolTime)
		{
			coolTime.Text = "00h 00m 00s";
		}
		else
		{
			int nCoolTime = skillLevelRecord.CoolTime / 1000;
			int hour = nCoolTime / 3600;
			int min = ( nCoolTime % 3600) / 60;
			int sec = ( nCoolTime % 3600) % 60;
			
			sb.Remove( 0, sb.Length);
			
			if( 0 == hour)
			{
				if( 0 == min)
				{
					sb.AppendFormat( "{0:D}{1}", sec, AsTableManager.Instance.GetTbl_String(90));
					coolTime.Text = sb.ToString();
				}
				else
				{
					sb.AppendFormat( "{0:D}{1} {2:D}{3}", min, AsTableManager.Instance.GetTbl_String(89), sec, AsTableManager.Instance.GetTbl_String(90));
					coolTime.Text = sb.ToString();
				}
			}
			else
			{
				sb.AppendFormat( "{0:D}{1} {2:D}{3} {4:D}{5}", hour, AsTableManager.Instance.GetTbl_String(88),
					min, AsTableManager.Instance.GetTbl_String(89), sec, AsTableManager.Instance.GetTbl_String(90));
				coolTime.Text = sb.ToString();
			}
		}
		
		manaCost.Text = skillLevelRecord.Mp_Decrease.ToString();
		sb.Remove( 0, sb.Length);
		sb.Append( AsTableManager.Instance.GetTbl_String(134));
		sb.Append( ' ');
		sb.Append( skillLevelRecord.Level_Limit.ToString());

		AsUserEntity userEntity = AsUserInfo.Instance.GetCurrentUserEntity();
		int userLevel = userEntity.GetProperty<int>( eComponentProperty.LEVEL);
		if( userLevel < skillLevelRecord.Level_Limit)
		{
			UIButton btn = buyBtn.GetComponent<UIButton>();
			btn.SetControlState( UIButton.CONTROL_STATE.DISABLED);
			btn.spriteText.Color = Color.gray;
			sb.Insert( 0, Color.red.ToString());
		}
		needLev.Text = sb.ToString();

		sb.Remove( 0, sb.Length);
		sb.Append( price.ToString( "#,#0", CultureInfo.InvariantCulture));
		if( AsUserInfo.Instance.SavedCharStat.nGold < (ulong)price)
		{
			UIButton btn = buyBtn.GetComponent<UIButton>();
			btn.SetControlState( UIButton.CONTROL_STATE.DISABLED);
			btn.spriteText.Color = Color.gray;
			sb.Insert( 0, Color.red.ToString());
			cost.Text = sb.ToString();
		}
		else
		{
			sb.Insert( 0, Color.yellow.ToString());
			cost.Text = sb.ToString();
		}
	}
示例#26
0
	public override void LoadTable(string _path)
	{
		int idx = 0;
		int idx2 = 0;
		
		try
		{
			if( (null != AssetbundleManager.Instance && true == AssetbundleManager.Instance.useAssetbundle) || true == AsTableManager.Instance.useReadBinary )
			{
				// Ready Binary
				TextAsset textAsset = ResourceLoad.LoadTextAsset( _path);
				MemoryStream stream = new MemoryStream( textAsset.bytes);
				BinaryReader br = new BinaryReader( stream);
				
				int nCount = br.ReadInt32();
				
				//debug
				idx2++;

				for( int i = 0; i < nCount; i++)
				{
					Tbl_Skill_Record record = new Tbl_Skill_Record( br);
					m_ResourceTable.Add(record.Index, record);
					
					idx++;
				}
				
				br.Close();
				stream.Close();
			}
			else
			{
				XmlElement root = GetXmlRootElement(_path);
				XmlNodeList nodes = root.ChildNodes;
				
				//debug
				idx2++;
				
				foreach(XmlNode node in nodes)
				{
					Tbl_Skill_Record record = new Tbl_Skill_Record((XmlElement)node);
					m_ResourceTable.Add(record.Index, record);
					
					idx++;
				}
			}
			
			//debug
			idx2++;
			
			foreach(KeyValuePair<int, Tbl_Skill_Record> pair in m_ResourceTable)
			{
				m_ClassTypeTable.Add(pair.Value.Class, pair.Value);
			}
			
			//debug
			idx2++;
			
			foreach(KeyValuePair<int, Tbl_Skill_Record> pair in m_ResourceTable)
			{
				Tbl_Skill_Record record = pair.Value;
				if(record.Skill_Type == eSKILL_TYPE.Base)
				{
					m_mdicBaseSkill.Add(record.Class, record);
				}
			}
			
			idx2 = 0;
			idx++;
			
//			foreach(KeyValuePair<int, Tbl_Skill_Record> pair in m_ResourceTable)
//			{
//				Tbl_Skill_Record record = pair.Value;
//				
//				if(record.Command_Type == eCommand_Type.DoubleTab)
//				{
//					if(m_ddicDoubleTabSkill.ContainsKey(record.Class) == false)
//						m_ddicDoubleTabSkill.Add(record.Class, new Dictionary<eCommandPicking_Type, Tbl_Skill_Record>());
//					
//					m_ddicDoubleTabSkill[record.Class].Add(record.CommandPicking_Type, record);
//				}
//			}
		}
		catch(System.Exception e)
		{
			Debug.LogError("Tbl_Skill::LoadTable: exception occurred at " + idx + "th data.");
			Debug.LogError("Tbl_Skill::LoadTable: exception occurred at " + idx2 + "th part.");
			Debug.LogError(e);
		}
	}
示例#27
0
	public Msg_Player_Skill_Ready( Msg_Player_Skill_Ready _ready, Tbl_Action_Record _action)
	{
		skillRecord_ = _ready.skillRecord;
		skillLv_ = _ready.skillLv_;
		skillLvRecord_ = _ready.skillLvRecord;
		actionRecord_ = _action;//IMPORTANT

		pickedEntity_ = _ready.pickedEntity;

		head_ = _ready.head;
		center_ = _ready.center;
		tail_ = _ready.tail;
		direction_ = _ready.direction;
		cw_ = _ready.cw;

		constructSucceed_ = true;
	}
示例#28
0
	public SuitableBasicSkill(bool _inRange, Tbl_Skill_Record _skill)
	{
		m_InRange = _inRange;
		m_Skill = _skill;
	}
示例#29
0
	public void Init( Tbl_Skill_Record skillRecord, Tbl_SkillLevel_Record skillLevelRecord)
	{
		GameObject obj = Resources.Load( skillRecord.Skill_Icon) as GameObject;
		if( null == obj )
		{
			Debug.LogError("AsSkillTooltip::Init()");
			return;
		}
		
		goIcon = GameObject.Instantiate( obj) as GameObject;
		goIcon.transform.parent = icon.transform;
		goIcon.transform.localPosition = new Vector3( 0.0f, 0.0f, -0.5f);
		goIcon.transform.localRotation = Quaternion.identity;
		goIcon.transform.localScale = Vector3.one;
		
		if( eSKILL_TYPE.Passive == skillRecord.Skill_Type)
		{
			coolTimeText.gameObject.SetActiveRecursively( false);
			coolTime.gameObject.SetActiveRecursively( false);
			manaCostText.gameObject.SetActiveRecursively( false);
			manaCost.gameObject.SetActiveRecursively( false);
		}
		
		maxChargeStep = skillLevelRecord.ChargeMaxStep;
		if( int.MaxValue != maxChargeStep)
		{
			chargeStep.Text = curChargeStep.ToString();
			chargeStep.gameObject.SetActiveRecursively( true);
			chargeStepText.gameObject.SetActiveRecursively( true);
			prevBtn.gameObject.SetActiveRecursively( true);
			nextBtn.gameObject.SetActiveRecursively( true);
			skillLevelRecord = AsTableManager.Instance.GetTbl_SkillLevel_Record( level, id, curChargeStep);
		}
		else
		{
			chargeStep.gameObject.SetActiveRecursively( false);
			chargeStepText.gameObject.SetActiveRecursively( false);
			prevBtn.gameObject.SetActiveRecursively( false);
			nextBtn.gameObject.SetActiveRecursively( false);
		}
		
		string szDesc = AsTableManager.Instance.GetTbl_String( skillRecord.Description_Index);
		szDesc = AsUtil.ModifyDescriptionInTooltip( szDesc, id, level, curChargeStep);
		
		nameField.Text = AsTableManager.Instance.GetTbl_String( skillRecord.SkillName_Index);
		lv.Text = "Lv." + level;
		desc.Text = szDesc;

		if( int.MaxValue == skillLevelRecord.CoolTime)
		{
			coolTime.Text = "00h 00m 00s";
		}
		else
		{
			int nCoolTime = skillLevelRecord.CoolTime / 1000;
			int hour = nCoolTime / 3600;
			int min = ( nCoolTime % 3600) / 60;
			int sec = ( nCoolTime % 3600) % 60;
			
			
			if( 0 == hour && 0 == min )
			{
				//sec
				coolTime.Text = string.Format( "{0:D}{1}", sec, AsTableManager.Instance.GetTbl_String(90)); // sec
			}
			else if( 0 == hour )					
			{
				//min
				if( 0 == sec )
				{
					coolTime.Text = string.Format( "{0:D}{1}", min, AsTableManager.Instance.GetTbl_String(89)); 	
				}
				else
				{
					coolTime.Text = string.Format( "{0:D}{1} {2:D}{3}", min, AsTableManager.Instance.GetTbl_String(89),
						sec, AsTableManager.Instance.GetTbl_String(90));
				}
			}
			else
			{
				// hour
				if( 0 == min && 0 == sec )
				{
					coolTime.Text = string.Format( "{0:D}{1}", hour, AsTableManager.Instance.GetTbl_String(931)); 
				}
				else if( 0 == sec )
				{
					coolTime.Text = string.Format( "{0:D}{1} {2:D}{3}", hour, AsTableManager.Instance.GetTbl_String(931),
						min, AsTableManager.Instance.GetTbl_String(89));
				}
				else if( 0 == min )
				{
					coolTime.Text = string.Format( "{0:D}{1} {2:D}{3}", hour, AsTableManager.Instance.GetTbl_String(931),
						sec, AsTableManager.Instance.GetTbl_String(90));
				}
				else
				{
					coolTime.Text = string.Format( "{0:D}{1} {2:D}{3} {4:D}{5}", hour, AsTableManager.Instance.GetTbl_String(931),
						min, AsTableManager.Instance.GetTbl_String(89), sec, AsTableManager.Instance.GetTbl_String(90));
				}
			}		
		}
		
		manaCost.Text = skillLevelRecord.Mp_Decrease.ToString();

		StartCoroutine(WaitEnoughClose());
	}