Ejemplo n.º 1
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());
	}
Ejemplo n.º 2
0
	public void SetTooltip(Tbl_Skill_Record _skill, Tbl_SkillLevel_Record _skillLv)
	{
		tooltip.Init(_skill, _skillLv);
	}
Ejemplo n.º 3
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;
		}
	}
Ejemplo n.º 4
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());
	}
Ejemplo n.º 5
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;
			}
		}
	}
Ejemplo n.º 6
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;
			}
		}
	}
Ejemplo n.º 7
0
	// < ilmeda, 20120817
	private void _SetCommandSkillActionCancelTime(Tbl_SkillLevel_Record curSkillLevelData)
	{
		if( null == curSkillLevelData)
			return;

		Tbl_Action_Record actionRecord = null;
		AsUserEntity userEntity = AsUserInfo.Instance.GetCurrentUserEntity();
		eGENDER gender = userEntity.GetProperty<eGENDER>( eComponentProperty.GENDER);
		switch( gender)
		{
		case eGENDER.eGENDER_FEMALE:
			actionRecord = AsTableManager.Instance.GetTbl_Action_Record( curSkillLevelData.SkillAction_Index_Female);
			break;
		case eGENDER.eGENDER_MALE:
			actionRecord = AsTableManager.Instance.GetTbl_Action_Record( curSkillLevelData.SkillAction_Index);
			break;
		default:
			Debug.LogError( "Invalid gender");
			break;
		}

		if( null == actionRecord)
			Debug.LogError( "null == actionRecord");

		cancelList. Clear();
		if( ( null != actionRecord.HitAnimation) && ( 0 < actionRecord.HitAnimation.listCancel.Count))
		{
			foreach( Tbl_Action_Cancel cancel in actionRecord.HitAnimation.listCancel)
				cancelList.Add( cancel);
		}
		actionTime = Time.time;
	}
Ejemplo n.º 8
0
	// skill
	public void SetSkill( int iSkill, int iLevel)
	{
		ChargeCancel();
		if( 0 == iSkill || 0 == iLevel)
		{
			m_curSkillLevelRecord = null;
			DeleteIcon();			
			iSkill = 0;
			iLevel = 0;
			SetType( SLOT_TYPE.SLT_CT_SKILL | SLOT_TYPE.SLT_INVALID);
			return;
		}

		/*if( iSkill == m_iSkillId && iLevel == m_iSkillLevel && null != m_goIcon)
		{
			m_goIcon.transform.localPosition = new Vector3( 0.0f, 0.0f, -0.5f);
			return;
		}*/

		m_iItemID = 0;
		m_RealItem = null;
		m_sItem = null;
		m_iSkillId = iSkill;
		m_iSkillLevel = iLevel;

		Tbl_SkillLevel_Record curSkillLevelData = AsTableManager.Instance.GetTbl_SkillLevel_Record( m_iSkillLevel, m_iSkillId, 0);
		if( null == curSkillLevelData)
		{
			Debug.LogError( "AsSlot::SetSkill() [ null == curSkillLevelData ]");
			return;
		}
		m_curSkillLevelRecord = curSkillLevelData;

		DeleteIcon();
		CreateSkillIcon( iSkill, new Vector3( 0.0f, 0.0f, -0.5f));
		
		ChargeTime = curSkillLevelData.ChargeDuration * 0.001f;
		ChargeStep = curSkillLevelData.ChargeMaxStep;

		Tbl_Skill_Record skillrecord = AsTableManager.Instance.GetTbl_Skill_Record( iSkill);
		if( null != skillrecord)
		{
			SetType( SLOT_TYPE.SLT_CT_SKILL | GetSlotType( skillrecord.Skill_Type));
			m_UseOnly_Movable = skillrecord.CheckSkillUsingOnly_Movable();
			m_DisableSkill_PvP = ( skillrecord.DisableInPvP == eDisableInPvP.Disable);
			m_DisableSkill_Raid = ( skillrecord.DisableInRaid == eDisableInRaid.Disable);
            m_DisableSkill_Field = (skillrecord.DisableInField == eDisableInRaid.Disable);
			m_DisableSkill_Indun = ( skillrecord.DisableInInDun == eDisableInInDun.Disable);

			if( SkillBook.Instance.StanceInfo.StanceSkill == iSkill)
				StanceChanged( SkillBook.Instance.StanceInfo);
		}
	}
Ejemplo n.º 9
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++;
			}
		}
	}
Ejemplo n.º 10
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);
	}
Ejemplo n.º 11
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);
	}
Ejemplo n.º 12
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;
	}
Ejemplo n.º 13
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;
	}
Ejemplo n.º 14
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;
	}
Ejemplo n.º 15
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)]));
	}
Ejemplo n.º 16
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;
	}
Ejemplo n.º 17
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");
		}
	}
Ejemplo n.º 18
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();
				
				for( int i = 0; i < nCount; i++)
				{
					Tbl_SkillLevel_Record record = new Tbl_SkillLevel_Record( br);
					m_ResourceTable.Add(record.Index, record);
					
					idx2++;
				}
				
				br.Close();
				stream.Close();
			}
			else
			{
				XmlElement root = GetXmlRootElement(_path);
				XmlNodeList nodes = root.ChildNodes;
				
				//debug
				idx2++;
				
				foreach(XmlNode node in nodes)
				{
					Tbl_SkillLevel_Record record = new Tbl_SkillLevel_Record((XmlElement)node);
					m_ResourceTable.Add(record.Index, record);
					
					idx2++;
				}
			}
			
			//debug
			idx2++;
			
			List<Tbl_SkillLevel_Record> chargeableSkillLv = new List<Tbl_SkillLevel_Record>();
			foreach(KeyValuePair<int, Tbl_SkillLevel_Record> pair in m_ResourceTable)
			{
				if(pair.Value.ChargeStep != int.MaxValue)// && pair.Value.ChargeStep != 0)
				{
					chargeableSkillLv.Add(pair.Value);
				}
				else
				{
					if(m_ddicTable.ContainsKey(pair.Value.Skill_Level) == false)
						m_ddicTable.Add(pair.Value.Skill_Level, new Dictionary<int, Tbl_SkillLevel_Record>());
					
//					if(m_ddicTable[pair.Value.Skill_Level].ContainsKey(pair.Value.Skill_GroupIndex) == false)
					m_ddicTable[pair.Value.Skill_Level].Add(pair.Value.Skill_GroupIndex, pair.Value);
				}
			}
			
			//debug
			idx2++;
			
			foreach(Tbl_SkillLevel_Record record in chargeableSkillLv)
			{
				if(m_dddicCharge.ContainsKey(record.Skill_Level) == false)
					m_dddicCharge.Add(record.Skill_Level, new Dictionary<int, Dictionary<int, Tbl_SkillLevel_Record>>());
				
				if(m_dddicCharge[record.Skill_Level].ContainsKey(record.Skill_GroupIndex) == false)
					m_dddicCharge[record.Skill_Level].Add(record.Skill_GroupIndex, new Dictionary<int, Tbl_SkillLevel_Record>());
				
				m_dddicCharge[record.Skill_Level][record.Skill_GroupIndex].Add(record.ChargeStep, record);
			}
			
			idx2 = 0;
			idx++;
		}
		catch(System.Exception e)
		{
			Debug.LogError("Tbl_SkillLevel::LoadTable: exception occurred at " + idx + "th data.");
			Debug.LogError("Tbl_SkillLevel::LoadTable: exception occurred at " + idx2 + "th part.");
			Debug.LogError(e);
		}
	}
Ejemplo n.º 19
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();
		}
	}