Beispiel #1
0
    public static BodyPart[] ToBodyParts(this PotionSlot potionSlot)
    {
        switch (potionSlot)
        {
        case PotionSlot.HEAD:
            return(new BodyPart[] { BodyPart.HEAD });

        case PotionSlot.FACE:
            return(new BodyPart[] { BodyPart.FACE });

        case PotionSlot.TORSO:
            return(new BodyPart[] { BodyPart.TORSO });

        case PotionSlot.ARMS:
            return(new BodyPart[] { BodyPart.LEFT_ARM, BodyPart.RIGHT_ARM });

        case PotionSlot.LEGS:
            return(new BodyPart[] { BodyPart.LEFT_LEG, BodyPart.RIGHT_LEG });

        case PotionSlot.WINGS:
            return(new BodyPart[] { BodyPart.WINGS });

        case PotionSlot.TAIL:
            return(new BodyPart[] { BodyPart.TAIL });

        case PotionSlot.NONE:
            return(new BodyPart[] { });

        default:
            throw new ArgumentException("Unrecognized PotionSlot enum value: " + potionSlot);
        }
    }
    public Aspects.Secondary? GetAspectForPotionSlot(PotionSlot slot)
    {
        BodyPart[] parts = slot.ToBodyParts();
        if (parts.Length == 0) {
            return null;
        }

        Transform partTransform = bodyPartToTransform(parts[0]);

        return PlayerSprites.instance().getAspect(parts[0], partTransform.GetComponent<SpriteRenderer>().sprite);
    }
    public Aspects.Secondary?GetAspectForPotionSlot(PotionSlot slot)
    {
        BodyPart[] parts = slot.ToBodyParts();
        if (parts.Length == 0)
        {
            return(null);
        }

        Transform partTransform = bodyPartToTransform(parts[0]);

        return(PlayerSprites.instance().getAspect(parts[0], partTransform.GetComponent <SpriteRenderer>().sprite));
    }
Beispiel #4
0
    public Potion(Aspects.Primary primary1, Aspects.Primary primary2, Aspects.Primary primary3,
                  MultiSet<Aspects.Secondary> secondaries, PotionSlot slot, Aspects.Secondary type, Effect effect)
    {
        primaries = new MultiSet<Aspects.Primary>();
        primaries.Add(primary1);
        primaries.Add(primary2);
        primaries.Add(primary3);

        this.secondaries = new MultiSet<Aspects.Secondary>(secondaries);

        _slot = slot;
        _type = type;
        _effect = effect;
    }
Beispiel #5
0
    public Potion(Aspects.Primary primary1, Aspects.Primary primary2, Aspects.Primary primary3,
                  MultiSet <Aspects.Secondary> secondaries, PotionSlot slot, Aspects.Secondary type, Effect effect)
    {
        primaries = new MultiSet <Aspects.Primary>();
        primaries.Add(primary1);
        primaries.Add(primary2);
        primaries.Add(primary3);

        this.secondaries = new MultiSet <Aspects.Secondary>(secondaries);

        _slot   = slot;
        _type   = type;
        _effect = effect;
    }
Beispiel #6
0
    public void add(Aspects.Primary primary1, Aspects.Primary primary2, Aspects.Primary primary3, MultiSet<Aspects.Secondary> secondaries, PotionSlot slot, Aspects.Secondary type, Effect effect)
    {
        Potion potion = new Potion(primary1, primary2, primary3, secondaries, slot, type, effect);
        MultiSet<Aspects.Primary> primaries = new MultiSet<Aspects.Primary>();
        primaries.Add(primary1);
        primaries.Add(primary2);
        primaries.Add(primary3);

        if (!potions.ContainsKey(primaries)) {
            potions.Add(primaries, new List<Potion>());
        }

        potions[primaries].Add(potion);
    }
    public void setEffect(PotionSlot part, Effect effect)
    {
        if (_potionEffects.ContainsKey(part)) {
            Effect currentEffect = _potionEffects[part];
            if (currentEffect != null) {
                currentEffect.UnTrigger();
            }
        }

        _potionEffects[part] = effect;
        if (effect != null)
        {
            effect.Trigger();
        }
    }
    public void setEffect(PotionSlot part, Effect effect)
    {
        if (_potionEffects.ContainsKey(part))
        {
            Effect currentEffect = _potionEffects[part];
            if (currentEffect != null)
            {
                currentEffect.UnTrigger();
            }
        }

        _potionEffects[part] = effect;
        if (effect != null)
        {
            effect.Trigger();
        }
    }
Beispiel #9
0
    public void add(Aspects.Primary primary1, Aspects.Primary primary2, Aspects.Primary primary3, MultiSet <Aspects.Secondary> secondaries, PotionSlot slot, Aspects.Secondary type, Effect effect)
    {
        Potion potion = new Potion(primary1, primary2, primary3, secondaries, slot, type, effect);
        MultiSet <Aspects.Primary> primaries = new MultiSet <Aspects.Primary>();

        primaries.Add(primary1);
        primaries.Add(primary2);
        primaries.Add(primary3);

        if (!potions.ContainsKey(primaries))
        {
            potions.Add(primaries, new List <Potion>());
        }

        potions[primaries].Add(potion);
    }