public static void Handle(IBattleEntity target, IBattleEntity sender, BCardDto bcard) { var random = ChickenContainer.Instance.Resolve <IRandomGenerator>(); if (random.Next() >= bcard.FirstData) { return; } CardDto card = ChickenContainer.Instance.Resolve <ICardService>().GetById(bcard.SecondData); if (card == null) { Log.Debug($"Couldn't find any buff with card Id : {bcard.SecondData}"); return; } var buff = new BuffContainer(card, sender.Level); target.AddBuff(buff); if (target is IPlayerEntity player) { player.SendPacketAsync(player.GenerateBfPacket(buff)); } }
public static void AddBuff(this IBattleEntity entity, BuffContainer buffContainer) { if (entity.GetBuffByCardId(buffContainer.Id) == null) { entity.Buffs.Add(buffContainer); } }
//public Flags ActorFlags { get; set; } public ActorData(string key) : base(key) { buffContainer = new BuffContainer(); isAlive = true; equipment = new Equipment(); Relationships = new Relationship(); inventory = new Inventory(); toolbaar = new ToolBarData(); actorPropertyTags = new List <string>(); // Relationships = new Relationship(); blockAttack = false; blockMove = false; JobDataState = new JobDataState(); cooldownMap = new CooldownMap(); primaryJob = ""; secondaryJob = ""; description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vitae nunc eget leo maximus scelerisque commodo ut ex. Nulla iaculis dui erat, a pharetra ipsum pharetra a. Vestibulum sed commodo nisl, non feugiat nunc."; deathThreshold = 0; currentStatCollection = new StatsContainer(); maxStatCollection = new StatsContainer(); }
public override void EndEffects(TileNode node) { if (node.HasActor()) { //if there are more stacks of a buff on the tile than are the max stack for that buff on the actor, don't remove the // the buff from the actor // EX. 2 stacks of the the buff on the tile // actor can only have one stack of that buff // don't remove the buff, but remove the effect from the tile int effectCount = 0; int buffStackLimit = Globals.campaign.contentLibrary.buffDatabase.GetCopy(buffToAdd).maxStacks; BuffContainer bc = node.actorOnTile.actorData.buffContainer; foreach (TileEffect e in node.tileEffects) { if (e.GetKey() == key) { effectCount++; } } if (effectCount > buffStackLimit) { //node.tileEffects.Remove(this); return; } } base.EndEffects(node); }
public static void RemoveBuffById(this IBattleEntity entity, long id) { BuffContainer buffContainer = entity.GetBuffByCardId(id); if (buffContainer != null) { entity.Buffs.Remove(buffContainer); } }
public BuffContainer Copy() { BuffContainer bc = new BuffContainer(); foreach (Buff b in buffList) { bc.buffList.Add(b.Copy() as Buff); } return(bc); }
public static BfPacket GenerateBfPacket(this IPlayerEntity player, BuffContainer buff) { return(new BfPacket { VisualType = player.Type, VisualId = player.Id, BuffId = buff.Id, BuffLevel = buff.Level, ChargeValue = 0, Duration = buff.Duration, }); }
void Awake() { Tags = new DynamicTags(); _inventory = new ItemCollection(this); _attributes = QuarkMain.GetInstance().Config.DefaultAttributes.DeepCopy(); _attributes.SetCarrier(this); _regularBuffs = new BuffContainer(this); _hiddenBuffs = new BuffContainer(this); _casting = new List <Cast>(); _interruptConditions = QuarkMain.GetInstance().Config.DefaultInterruption.DeepCopy(); Configure(); }
void Awake() { m_BuffContainer = new BuffContainer(this); }
public ShieldBuff(BuffContainer container) : base(container) { destroyBoat = container.Obj.GetComponent <DestroyBoat>(); settings = (ScriptableShieldBuff)container.Buff; shieldSphere = container.Obj.transform.GetChild(0).gameObject; }
public Buff(BuffContainer container) { this.container = container; }
public SpeedBuff(BuffContainer container) : base(container) { engine = container.Obj.GetComponent <BoatEngine>(); settings = (ScriptableSpeedBuff)container.Buff; }
public BarrageBuff(BuffContainer container) : base(container) { dropper = container.Obj.GetComponent <ItemDropper>(); settings = (ScriptableBarrageBuff)container.Buff; barrelReleaseAnim = dropper.barrelReleaseAnim; }
// Use this for initialization void Start() { if (animation) { animation ["Walk"].speed = 5.0f; } runnerAbility = new RunnerAbility (); buffContainer = new BuffContainer (); tmpBuff = new Buff_SpeedBoost (); int sw = Screen.width, sh = Screen.height; //rectMoveTouchIgnore = new Rect (0, sh - tmpBuff.IconTexture.height, tmpBuff.IconTexture.width * 3, tmpBuff.IconTexture.height); rectMoveTouchIgnore = new Rect (0, 0, tmpBuff.IconTexture.width * 3, tmpBuff.IconTexture.height); Debug.Log(string.Format("rectMoveTouchIgnore={0}", rectMoveTouchIgnore)); }