public SerializedActiveBuff(ActiveBuff buff) { Id = buff.Id; SkillId = buff.SkillId; SkillLevel = buff.SkillLevel; CountDownInSeconds = buff.CountDownInSeconds; }
private void Character_OnSkillKeep(IKillable sender, ActiveBuff buff, AttackResult result) { foreach (var player in GetAllPlayers(true)) { _packetsHelper.SendSkillKeep(player.Client, sender.Id, buff.SkillId, buff.SkillLevel, result); } }
/// <summary> /// Notifies other players, that player added buff to someone. /// </summary> private void Character_OnAddedBuff(Character sender, IKillable receiver, ActiveBuff buff) { foreach (var player in Players) { _packetHelper.SendCharacterAddedBuff(player.Value.Client, sender, receiver, buff); } }
public void Setup() { character = new BattleCharacter(); character.Skills = new List <ISkill>(); character.Stats = new Stats(); character.ActiveBuffs = new List <ActiveBuff>(); activeBuff = BuffFactory.GetActiveBuff(new TestBuff(), character); }
public void MobNotifiesWhenItGetsBuff() { var mob = new Mob(mobLoggerMock.Object, databasePreloader.Object, Wolf.Id, true, new MoveArea(0, 0, 0, 0, 0, 0), testMap); ActiveBuff buff = null; mob.OnBuffAdded += (IKillable sender, ActiveBuff newBuff) => { buff = newBuff; }; mob.AddActiveBuff(new Skill(MagicRoots_Lvl1, 0, 0), null); Assert.Single(mob.ActiveBuffs); Assert.NotNull(buff); }
internal void SendTargetRemoveBuff(IWorldClient client, IKillable target, ActiveBuff buff) { using var packet = new Packet(PacketType.TARGET_BUFF_REMOVE); if (target is Mob) { packet.WriteByte(2); } else { packet.WriteByte(1); } packet.Write(target.Id); packet.Write(buff.SkillId); packet.Write(buff.SkillLevel); client.SendPacket(packet); }
internal void SendRemoveBuff(WorldClient client, ActiveBuff buff) { using var packet = new Packet(PacketType.BUFF_REMOVE); packet.Write(buff.Id); client.SendPacket(packet); }
internal void SendAddBuff(WorldClient client, ActiveBuff buff) { using var packet = new Packet(PacketType.BUFF_ADD); packet.Write(new SerializedActiveBuff(buff).Serialize()); client.SendPacket(packet); }
protected override void BuffAdded(ActiveBuff buff) { base.BuffAdded(buff); }
//===== //===== //===== Public Methods ------------------------------------------------ //===== //===== // // Add only // public void AddActiveBuff(ActiveBuff effect) { activeBuffs.Add(effect); }
public PartyMemberBuff(ActiveBuff buff) { SkillId = buff.SkillId; SkillLevel = buff.SkillLevel; CountDownInSeconds = buff.CountDownInSeconds; }
internal void SendCharacterAddedBuff(WorldClient client, Character sender, IKillable receiver, ActiveBuff buff) { using var packet = new Packet(PacketType.CHARACTER_ADDED_BUFF); packet.Write(false); // IsFailed? packet.Write(sender.Id); packet.Write(receiver.Id); packet.Write(buff.SkillId); packet.Write(buff.SkillLevel); client.SendPacket(packet); }
public TargetBuff(ActiveBuff buff) { SkillId = buff.SkillId; SkillLevel = buff.SkillLevel; CountDownInSeconds = buff.CountDownInSeconds; }
public static Ability loadAbility(string abilityLink) { var textAsset = (TextAsset)Resources.Load(abilityLink); var xmldoc = new XmlDocument(); xmldoc.LoadXml(textAsset.text); var xmlAbility = xmldoc.GetElementsByTagName("ability").Item(0); Ability ability = null; switch (xmlAbility["type"].InnerText) { case "basicAbility": ability = new Ability(); ability.setAbstractTactic(new DamageSpellCastTactic(3)); break; case "summonAbility": var summon = loadPerson(xmlAbility["summon"].InnerText); var summonAbility = new SummonAbility(); var tactic = new SummonCastTactic(3); tactic.summon = summon; summonAbility.setAbstractTactic(tactic); summonAbility.person = summon; ability = summonAbility; break; case "buffAbility": case "passiveAbility": var buff = new Buff(); buff.setAbstractTactic(new DamageSpellCastTactic(3)); buff.modificator = getModificators(xmlAbility["modificators"])[0]; buff.duration = float.Parse(xmlAbility["duration"].InnerText); ability = buff; break; case "activeBuff": ability = new ActiveBuff(); ability.setAbstractTactic(new DamageSpellCastTactic(3)); break; } ability.name = xmlAbility["name"].InnerText; ability.type = xmlAbility["type"].InnerText; ability.resource = abilityLink; ability.timeCast = float.Parse(xmlAbility["timeCast"].InnerText); ability.manaCost = float.Parse(xmlAbility["manaCost"].InnerText); ability.cooldown = float.Parse(xmlAbility["cooldown"].InnerText); ability.targetType = getTargetType(xmlAbility["targetType"].InnerText); ability.targetTactic = getTargetTactic(xmlAbility["targetTactic"].InnerText, ability); ability.animation = xmlAbility["animation"].InnerText; ability.image = Constants.loadSprite(xmlAbility["sprite"].InnerText, xmlAbility["image"].InnerText); foreach (XmlNode node in xmlAbility["effects"]) { ability.effectList.Add(getEffect(node, ability)); } return(ability); }