//------------- Buff and Debuff ---------------- // On this section, Debuff is called 'CastedBuff'. void CastBuff(Dictionary <SkillType, int> force) { NetworkInstanceId id = GetComponent <NetworkIdentity>().netId; KeyValuePair <SkillType[], int[]> Sforce = IVSkill.DicToPair(force); CmdCastBuff(id, Sforce.Key, Sforce.Value); }
void CastDebuff(Dictionary <SkillType, int> force) // cast player --> casted player { IVPlayer target = _hostserver.GetNearestPlayer(transform.position, Arrow.theta); KeyValuePair <SkillType[], int[]> Sforce = IVSkill.DicToPair(force); CmdCastedBuff(target.GetComponent <NetworkIdentity>().netId, Sforce.Key, Sforce.Value); }
//---------Skill Attack---------------- void SkillAttack(Dictionary <SkillType, int> force) { Vector3 dir = Arrow.GetDir(); Vector3 pos = transform.position; NetworkInstanceId i = GetComponent <NetworkIdentity>().netId; // It ensures this code will be executed on client KeyValuePair <SkillType[], int[]> Sforce = IVSkill.DicToPair(force); CmdSkillAttack(dir, pos, i, Sforce.Key, Sforce.Value); }