예제 #1
0
    public override void TakeMsg(ActorModel who, EventMsg msg)
    {
        switch (msg.Type)
        {
        case EventType.GetBumped:
            God.C.AddAction(new BumpAction(msg.Source, who.Location.x, who.Location.y));
            msg.Source.TakeMsg(new EventMsg(EventType.TakeDmg, who, God.Library.GetMonster(who.Species).Damage));
            who.Despawn();
            return;

        case EventType.GetName:
            msg.Text += " " + God.Library.GetMonster(who.Species).Type;
            return;
        }
    }
예제 #2
0
    public override void TakeMsg(ActorModel who, EventMsg msg)
    {
        switch (msg.Type)
        {
        case EventType.GetBumped:
            ActorModel bumper = msg.Source;
            if (bumper.Type == ThingTypes.Player)
            {
                TileModel loc = who.GetLocation();
                God.C.AddAction(new GetScoreAction(bumper, who));
                who.Despawn();
                ModelManager.ChangeScore(1);
                bumper.SetLocation(loc);
            }
            return;

        case EventType.GetName:
            msg.Text += " SCORETHING";
            return;
        }
    }
예제 #3
0
    public override void TakeMsg(ActorModel who, EventMsg msg)
    {
        switch (msg.Type)
        {
        case EventType.GetBumped:
            ActorModel bumper = msg.Source;
            if (bumper.Type == ThingTypes.Player)
            {
                if (God.GSM.scoreIsVisible)
                {
                    TileModel loc = who.GetLocation();
                    who.View.GetComponentInChildren <SpriteRenderer>().color = new Color32(255, 255, 255, 255);
                    who.View.transform.GetComponentInParent <TileView>().GetComponentInChildren <SpriteRenderer>().color = new Color32(255, 255, 255, 255);
                    God.C.AddAction(new GetScoreAction(bumper, who));
                    who.Despawn();
                    ModelManager.ChangeScore(1);
                    bumper.SetLocation(loc);
                }
            }
            return;

        case EventType.GetName:
            msg.Text += " SCORETHING";
            return;

        case EventType.ScoreMove:
            if (God.GSM.scoreMovement < God.GSM.monsterRound)
            {
                God.GSM.scoreMovement++;
            }
            else if (God.GSM.scoreMovement == God.GSM.monsterRound)
            {
                int rand = Random.Range(0, 2);
                Debug.Log(rand);
                if (rand == 1)
                {
                    if (who.Location.x > GameSettings.playerX)
                    {
                        who.Move(-1, 0);
                    }
                    else if (who.Location.x < GameSettings.playerX)
                    {
                        who.Move(1, 0);
                    }
                }
                else if (rand == 0)
                {
                    if (who.Location.y > GameSettings.playerY)
                    {
                        who.Move(0, -1);
                    }
                    else if (who.Location.y < GameSettings.playerY)
                    {
                        who.Move(0, 1);
                    }
                }
                //God.GSM.AS.PlayOneShot(God.GSM.StompClip);
                God.GSM.scoreMovement = 0;
            }
            return;
        }
    }