public static void Apply(EffectorData effectorData, BaseEntity2D owner) { if (owner.ImmuneEffector(effectorData)) { return; } Type effectorType = null; AbstractApplierEffector[] effectors = owner.GetComponents <AbstractApplierEffector>(); for (int index = 0; index < effectors.Length; index++) { if (effectors[index].data.id == effectorData.id) { return; } } if (effectorRegistry.TryGetValue(effectorData.id, out effectorType)) { AbstractApplierEffector effector = owner.gameObject.AddComponent(effectorType) as AbstractApplierEffector; effector.data = effectorData; effector.owner = owner; effector.Run(); } else { LogUtils.LogWarning("Not fount Weapon effector by ID " + effectorData.id); } }
public override bool ImmuneEffector(EffectorData effectorData) { MonsterData monster = data as MonsterData; if (monster.immunityEffectors.IndexOf(effectorData.id) != -1) { return(true); } return(false); }
public static EffectorData FromConfig(DisassemblygirlEffectorConfig config) { if (config == null) { return(null); } EffectorData effector = new EffectorData(); effector.id = config.id; effector.name = config.name; effector.iconID = config.iconID; effector.resourceID = config.resourceID; effector.parameter1 = config.parameter1; effector.parameter2 = config.parameter2; effector.parameter3 = config.parameter3; effector.parameter4 = config.parameter4; effector.parameter5 = config.parameter5; return(effector); }
public abstract bool ImmuneEffector(EffectorData effectorData);
public override bool ImmuneEffector(EffectorData effectorData) { throw new NotImplementedException(); }
public override bool ImmuneEffector(EffectorData effectorData) { return(true); }