public void AttackPlayer(NetworkIdentity id, int index, Dictionary <SkillType, int> force) { if (!isServer) { return; } else if (index == this.id) { IVPlayer p = id.gameObject.GetComponent <IVPlayer>(); int dmg = IVSpellManager.DamageCalculator(Calculate(true), p.Calculate(false)); RpcAttackPlayer(id, index, dmg); } }
// Use this for initialization void Start() { _speech = GetComponentInChildren <GCSpeechRecognition>(); if (_speech == null) { Debug.Log("Speech Recognition is null; return"); return; } _speech.configs[0].defaultLanguage = Enumerators.LanguageCode.ko_KR; _speech.RecognitionSuccessEvent += SpeechRecognizedSuccessEventHandler; _source = GetComponentInChildren <AudioSource>(); _source.Stop(); _spell = GameObject.Find("Manager").GetComponent <IVSpellManager>(); }
//---------Cast Section------------- public bool Cast(List <string> sentence) { if (!isLocalPlayer) { return(false); } else { int type = IVSpellManager.SyntaxCheck(sentence); if (type == 0) { Debug.Log("Syntax error"); GameObject obj = Instantiate(SkillFailed, transform.position + Vector3.up * 1.5f, Quaternion.identity); return(false); } Dictionary <SkillType, int> force; switch (type) { case 1: force = IVSpellManager.ForceCalculator(sentence, power); SkillAttack(force); break; case 2: force = IVSpellManager.ForceCalculator(sentence, new Dictionary <SkillType, int>(IVSpellManager.emptyforce)); CastBuff(force); break; case 0: case 3: force = IVSpellManager.ForceCalculator(sentence, new Dictionary <SkillType, int>(IVSpellManager.emptyforce)); CastDebuff(force); break; } return(true); } }