public void SeatDrinker(SBDrinker drinker)
    {
        if (currentDrinker != null) Debug.Log("you tried to sit on me you f*****g piece of shit f*****g cunthole!");

        currentDrinker = drinker;
        currentDrinker.VelocityComponent().Reset();
        currentDrinker.currentSittableComponent = this;
        currentDrinker.isBeingControlledBySittableComponent = true;

        Go.to(currentDrinker, 0.3f, new TweenConfig()
            .floatProp("x", this.owner.SpriteComponent(0).GetGlobalPosition().x)
            .floatProp("y", this.owner.SpriteComponent(0).GetGlobalPosition().y)
            .onComplete(HandleDrinkerFinishedSittingDown));
    }
Exemple #2
0
    public void PunchDrinker(SBDrinker drinker)
    {
        if (isPunching || isInBathroom || isActuallySitting || isBeingControlledBySittableComponent || isDrinking || isReceivingDrink) return;

        isPunching = true;

        //SpriteComponent(1).sprite.element = Futile.atlasManager.GetElementWithName("drinkerPunching.png");
        SpriteComponent(1).StartAnimation(WTMain.animationManager.AnimationForName("punch"));

        if (drinker != null) {
            Direction curDir = this.DirectionComponent().GetCurrentDirection();

            float amt = 1500;

            if (curDir == Direction.Left) {
                drinker.VelocityComponent().xVelocity = -amt;
                this.VelocityComponent().xVelocity = amt;
            }

            else if (curDir == Direction.Right) {
                drinker.VelocityComponent().xVelocity = amt;
                this.VelocityComponent().xVelocity = -amt;
            }

            else if (curDir == Direction.Down) {
                drinker.VelocityComponent().yVelocity = -amt;
                this.VelocityComponent().yVelocity = amt;
            }

            else if (curDir == Direction.Up) {
                drinker.VelocityComponent().yVelocity = amt;
                this.VelocityComponent().yVelocity = -amt;
            }

            if (drinker.HasDrink()) {
                FContainer mainContainer = this.container;

                SBDrink otherDrinkersDrink = drinker.currentDrink;
                drinker.currentDrink = null;
                Vector2 globalPos = drinker.rotatingContainer.LocalToGlobal(new Vector2(otherDrinkersDrink.x, otherDrinkersDrink.y));
                otherDrinkersDrink.RemoveFromContainer();
                otherDrinkersDrink.x = globalPos.x;
                otherDrinkersDrink.y = globalPos.y;
                otherDrinkersDrink.Spill(true);
                mainContainer.AddChild(otherDrinkersDrink);
                (mainContainer as SBGameScene).RefreshZOrders();
            }
        }
    }