public SpellController_Fireball(Message_ServerResponse_CreateSpellWithDirection spell, UnitySpellDefinition definition)
     : base(spell.request.spellType, definition, new Vector3(spell.request.spellXPos, UnityStaticValues.StaticYPos, spell.request.playerZPos), spell.request.TimeStartedCasting,
            new Vector3(spell.request.playerXPos, UnityStaticValues.StaticYPos, spell.request.playerZPos), spell.request.ownerGUID, spell.request.rank)
 {
     this.spell      = spell;
     direction       = new Vector3(spell.request.spellXDir, 0f, spell.request.spellZDir);
     unityDefinition = InGameWrapper.instance.spellsWrapper.spellData.GetSpellDefinition(SpellType.Fireball);
     InGameWrapper.instance.playersWrapper.GetPlayerByOwnerGUID(spell.request.ownerGUID).spellCaster.CastSpell(this, spell.request.playerXPos, spell.request.playerZPos);
 }
        public void Handle(object objData, Server_ServerClient client)
        {
            var data = (Message_ClientRequest_CreateSpellWithDirection)objData;
            Message_ServerResponse_CreateSpellWithDirection response = new Message_ServerResponse_CreateSpellWithDirection()
            {
                request = data,
                spellID = spellGUIDGenerator.GenerateGUID()
            };

            server.messageSender.SendToAll(response, server.clientManager.GetClients());
        }
    public void SpawnSpell(Message_ServerResponse_CreateSpellWithDirection spell, bool isMine)
    {
        var spellController = spellFactory.CreateSpell(spellData.GetSpellDefinition(spell.request.spellType), spell);

        spellsDictionary.Add(spell.spellID, spellController);
        if (isMine)
        {
            localSpells.Add(spellController);
        }
        else
        {
            onlineSpells.Add(spellController);
        }
    }
Example #4
0
 public ISpellController CreateSpellController(Message_ServerResponse_CreateSpellWithDirection spellResponse, UnitySpellDefinition definition)
 {
     return(new SpellController_Fireball(spellResponse, definition));
 }