Beispiel #1
0
    public override string ToChatString(GameWorldController gameWorldController)
    {
        MobData mobData  = gameWorldController.Model.GetMobData(MobID);
        MobType mobType  = MobTypeManager.GetMobTypeByName(mobData.mob_type_name);
        float   distance = Point3d.Distance(FromPosition, ToPosition);

        MathConstants.eDirection direction = MathConstants.GetDirectionForAngle(ToAngle);
        string facing = "";

        switch (direction)
        {
        case MathConstants.eDirection.none:
            facing = "South";
            break;

        case MathConstants.eDirection.right:
            facing = "East";
            break;

        case MathConstants.eDirection.up:
            facing = "North";
            break;

        case MathConstants.eDirection.left:
            facing = "West";
            break;

        case MathConstants.eDirection.down:
            facing = "South";
            break;
        }

        return(base.ToChatString(gameWorldController) + mobType.Name + " moved " + distance.ToString("F1") + " feet, now facing " + facing);
    }
    public override string ToChatString(GameWorldController gameWorldController)
    {
        MobData mobData = gameWorldController.Model.GetMobData(MobId);
        MobType mobType = MobTypeManager.GetMobTypeByName(mobData.mob_type_name);

        return(base.ToChatString(gameWorldController) + mobType.Name + " spotted an energy tank");
    }
    public override string ToChatString(GameWorldController gameWorldController)
    {
        MobData mobData = gameWorldController.Model.GetMobData(MobId);
        MobType mobType = MobTypeManager.GetMobTypeByName(mobData.mob_type_name);

        // TODO: Display what the mob ID attacked
        return(base.ToChatString(gameWorldController) + " " + mobType.Name + " attacked");
    }
    public override string ToChatString(GameWorldController gameWorldController)
    {
        MobData mobData       = gameWorldController.Model.GetMobData(MobId);
        MobType mobType       = MobTypeManager.GetMobTypeByName(mobData.mob_type_name);
        string  characterName = gameWorldController.Model.GetCharacterData(CharacterID).character_name;

        return(base.ToChatString(gameWorldController) + mobType.Name + " spotted " + characterName);
    }
    public override string ToChatString(GameWorldController gameWorldController)
    {
        string speakerName = "";

        MobData mobData = gameWorldController.Model.GetMobData(MobId);
        MobType mobType = MobTypeManager.GetMobTypeByName(mobData.mob_type_name);

        speakerName = mobType.Name;

        return(base.ToChatString(gameWorldController) + speakerName + " said \"" + Dialog + "\"");
    }
Beispiel #6
0
    public override string ToChatString(GameWorldController gameWorldController)
    {
        string hackerName = "";

        if (HackerFaction == GameConstants.eFaction.ai)
        {
            MobData mobData = gameWorldController.Model.GetMobData(HackerId);
            MobType mobType = MobTypeManager.GetMobTypeByName(mobData.mob_type_name);

            hackerName = mobType.Name;
        }
        else if (HackerFaction == GameConstants.eFaction.player)
        {
            hackerName = gameWorldController.Model.GetCharacterData(HackerId).character_name;
        }

        return(base.ToChatString(gameWorldController) + " Energy Tank hacked by " + hackerName);
    }
Beispiel #7
0
    public MobWidget(WidgetGroup parentGroup, MobWidgetStyle style, MobData mobData) :
        base(
            parentGroup,
            style.Width,
            style.Height,
            GameConstants.ConvertRoomPositionToPixelPosition(mobData.PositionInRoom).x,
            GameConstants.ConvertRoomPositionToPixelPosition(mobData.PositionInRoom).y) // Gross
    {
        MobType mobType = MobTypeManager.GetMobTypeByName(mobData.mob_type_name);

        m_style = style;

        m_title =
            new LabelWidget(
                this,
                style.LabelWidth,                                     // width
                style.LabelHeight,                                    // height
                (m_style.Width / 2.0f) - (m_style.LabelWidth / 2.0f), // local x
                -m_style.BoundsHeight - style.LabelHeight,            // local y
                mobType.Label);                                       // text
        m_title.Alignment = TextAnchor.UpperCenter;

        m_energy =
            new LabelWidget(
                this,
                style.LabelWidth,                                     // width
                style.LabelHeight,                                    // height
                (m_style.Width / 2.0f) - (m_style.LabelWidth / 2.0f), // local x
                0,                                                    // local y
                "");                                                  // text
        m_energy.Alignment = TextAnchor.UpperCenter;
        this.Energy        = mobData.energy;

        // Create the sprite game object
        {
            string archetype      = mobType.Name;
            string gameObjectPath = "Gfx/Sprites/Enemies/" + archetype + "/" + archetype + "_sprite";

            m_spriteObject =
                GameObject.Instantiate(
                    Resources.Load <GameObject>(gameObjectPath)) as GameObject;
            m_spriteAnimator = m_spriteObject.GetComponent <Animator>();

            UpdateWorldPosition();
        }

        // Create the dialog label
        m_dialog =
            new LabelWidget(
                this,
                style.DialogWidth,                                     // width
                style.DialogHeight,                                    // height
                (m_style.Width / 2.0f) - (m_style.DialogWidth / 2.0f), // local x
                m_title.LocalY - style.DialogHeight,                   // local y
                "");                                                   // text
        m_dialog.FontSize  = 14;
        m_dialog.Color     = Color.red;
        m_dialog.Alignment = TextAnchor.UpperCenter;
        m_dialog.Visible   = false;

        // Set the initial animation controller parameters
        m_spriteAnimator.SetFloat(SPEED_FLOAT_PARAMETER, 0.0f);
        m_spriteAnimator.SetFloat(FACING_X_FLOAT_PARAMETER, 0.0f);
        m_spriteAnimator.SetFloat(FACING_Y_FLOAT_PARAMETER, -1.0f);
        m_spriteAnimator.SetBool(IS_ATTACKING_BOOL_PARAMETER, false);

        // Create the vision cone
        m_visionCone =
            new VisionConeWidget(
                this,
                mobType.Name + mobData.mob_id.ToString(),
                mobType.VisionConeDistance,
                mobType.VisionConeAngleDegrees,
                0.0f,
                0.0f,
                0.0f);
        m_visionCone.ConeFacing = MathConstants.GetAngleForDirection(MathConstants.eDirection.down);
    }
Beispiel #8
0
    public override string ToChatString(GameWorldController gameWorldController)
    {
        MobType mobType = MobTypeManager.GetMobTypeByName(m_mobState.mob_type_name);

        return(base.ToChatString(gameWorldController) + mobType.Name + " spawned");
    }