Beispiel #1
0
    public override void Start()
    {
        charge_count_0        = GetLinkedObject("charge_count_0");
        charge_count_1        = GetLinkedObject("charge_count_1");
        charge_count_2        = GetLinkedObject("charge_count_2");
        charge_count_3        = GetLinkedObject("charge_count_3");
        daenerys_left_cd_text = GetLinkedObject("daenerys_left_cd_text");

        charge_img_0 = charge_count_0.GetComponent <CompImage>();
        charge_img_1 = charge_count_1.GetComponent <CompImage>();
        charge_img_2 = charge_count_2.GetComponent <CompImage>();
        charge_img_3 = charge_count_3.GetComponent <CompImage>();

        charge_img_0.SetEnabled(false);
        charge_img_1.SetEnabled(false);
        charge_img_2.SetEnabled(false);
        charge_img_3.SetEnabled(false);

        current_charges = 1;

        LinkTextTimer(daenerys_left_cd_text);
        ResetTextTimer();

        //Link to the external daenerys_obj
        daenerys_controller = GetLinkedObject("daenerys_obj").GetComponent <DaenerysController>();

        base.Start();
    }
    protected virtual void Start()
    {
        player = GetLinkedObject("player_obj");
        health = GetLinkedObject("health_obj").GetComponent <Hp>();

        stamina       = GetLinkedObject("stamina_obj").GetComponent <Stamina>();
        stamina_img   = stamina.GetComponent <CompImage>();
        leftamina_img = GetLinkedObject("leftamina_bar").GetComponent <CompImage>();

        mana          = GetLinkedObject("mana_obj").GetComponent <Mana>();
        mana_img      = mana.GetComponent <CompImage>();
        left_mana_img = GetLinkedObject("leftmana_bar").GetComponent <CompImage>();

        audio    = player.GetComponent <CompAudio>();
        movement = player.GetComponent <MovementController>();

        anim_controller = GetComponent <CompAnimation>();
        damage_feedback = player.GetComponent <DamageFeedback>();

        characters_manager = player.GetComponent <CharactersManager>();
        enemy_manager      = GetLinkedObject("player_enemies_manager").GetComponent <EnemiesManager>();

        play_breathing_audio      = false;
        currently_playing_b_audio = false;
        force_audio = false;
    }
Beispiel #3
0
    public void Start()
    {
        hp_bar_boss_background = GetLinkedObject("hp_bar_boss_background");
        hp_bar_boss_image      = GetLinkedObject("hp_bar_boss_image");
        hp_bar_boss_text       = GetLinkedObject("hp_bar_boss_text");

        player_icons           = GetLinkedObject("player_icons");
        player_icons_transform = player_icons.GetComponent <CompRectTransform>();
        icons_position         = player_icons_transform.GetUIPosition();

        hp_bar_parent           = GetLinkedObject("hp_bar_parent");
        hp_bar_parent_transform = hp_bar_parent.GetComponent <CompRectTransform>();
        hp_bar_parent_position  = hp_bar_parent_transform.GetUIPosition();

        hp_bar_img            = hp_bar_boss_background.GetComponent <CompImage>();
        hp_bar_img_background = GetComponent <CompImage>();

        hp_bar_img.SetAlpha(0.0f);
        hp_bar_img_background.SetAlpha(0.0f);
        hp_bar_appearing_timer = 0.0f;

        icons_position.y = icons_initial_y;
        player_icons_transform.SetUIPosition(icons_position);
        hp_bar_parent_position.y = hp_bar_initial_y;
        hp_bar_parent_transform.SetUIPosition(hp_bar_parent_position);

        appeared = false;
    }
Beispiel #4
0
        public PageGraphicRecog(MainWindow _mainWindow)
        {
            InitializeComponent();
            mMainWindow = _mainWindow;

            itemFileAddr     = FEITStandard.BASE_FOLDER + TEST_FOLDER + "items.csv";
            learningFileAddr = FEITStandard.BASE_FOLDER + TEST_FOLDER + "instruct.csv";

            mLearnList  = GRFormReader.GetList(learningFileAddr, GRFormReader.SCRIPT_TYPE.LEARNING);
            mDoList     = GRFormReader.GetList(itemFileAddr, GRFormReader.SCRIPT_TYPE.TEST);
            mUserAnswer = new List <String>();

            mLayout = new LayoutGFR(this);

            mImageGroup =
                new UIImageGroup(saveUserSelection, Next);

            mLearnImage1 = new CompImage(0);
            mLearnImage2 = new CompImage(0);
            mTargetImage = new CompImage(0);

            mTimer = new FEITTimer();

            mDoubleArrow        = new Image();
            mDoubleArrow.Width  = 90;
            mDoubleArrow.Height = 31;
            System.Drawing.Bitmap bmp = FiveElementsIntTest.Properties.Resources.DOUBLE_ARROW;
            mDoubleArrow.Source = BitmapSourceFactory.GetBitmapSource(bmp, out mIntPtr);

            if (!mMainWindow.mDB.TableExists(Names.GRAPH_ASSO_TABLENAME))
            {
                mMainWindow.mDB.CreateGraphAssoTable(GRFormReader.TOTAL_ITEM);
            }
        }
    public void SetStamina(float curr_stam, float max_stam)
    {
        curr_stamina = curr_stam;
        max_stamina  = max_stam;

        calc_stamina = curr_stamina / max_stamina;
        stamina_bar  = this_obj_stamina.GetComponent <CompImage>();
        stamina_bar.FillAmount(calc_stamina);
    }
Beispiel #6
0
    public void SetMana(float curr_man, float max_man)
    {
        curr_mana = curr_man;
        max_mana  = max_man;

        calc_mana = curr_mana / max_mana;
        mana_bar  = this_obj_mana.GetComponent <CompImage>();
        mana_bar.FillAmount(calc_mana);
    }
Beispiel #7
0
    public void SetHP(float curr_health, float max_health)
    {
        current_hp = curr_health;
        max_hp     = max_health;

        calc_hp = current_hp / max_hp;
        hp_bar  = this_obj_hp.GetComponent <CompImage>();
        hp_bar.FillAmount(calc_hp);
    }
    protected void LinkComponents(GameObject icon_obj, GameObject icon_hp_obj, GameObject icon_stamina_obj, GameObject icon_mana_obj,
                                  GameObject left_button_obj, GameObject right_button_obj, GameObject sec_button_obj, GameObject sec_button_idle_obj,
                                  GameObject left_counter_obj, GameObject right_counter_obj, GameObject sec_counter_obj,
                                  GameObject left_arm_obj, GameObject right_arm_obj,
                                  GameObject left_button_idle_obj, GameObject right_button_idle_obj)
    {
        //LEFT ARM
        left_arm = left_arm_obj.GetComponent <CompMesh>();

        //RIGHT ARM
        right_arm = right_arm_obj.GetComponent <CompMesh>();

        //LEFT BUTTON
        left_button     = left_button_obj.GetComponent <CompButton>();
        left_button_img = left_button_obj.GetComponent <CompImage>();
        if (left_counter_obj != null)
        {
            left_counter = left_counter_obj.GetComponent <CompText>();
        }
        left_button_idle_img = left_button_idle_obj.GetComponent <CompImage>();

        //RIGHT BUTTON
        right_button     = right_button_obj.GetComponent <CompButton>();
        right_button_img = right_button_obj.GetComponent <CompImage>();
        if (right_counter_obj != null)
        {
            right_counter = right_counter_obj.GetComponent <CompText>();
        }
        right_button_idle_img = right_button_idle_obj.GetComponent <CompImage>();

        //SECONDARY BUTTON
        sec_button     = sec_button_obj.GetComponent <CompButton>();
        sec_button_img = sec_button_obj.GetComponent <CompImage>();
        if (sec_counter_obj != null)
        {
            sec_counter = sec_counter_obj.GetComponent <CompText>();
        }
        sec_button_trans = sec_button_obj.GetComponent <CompRectTransform>();

        sec_button_idle_img   = sec_button_idle_obj.GetComponent <CompImage>();
        sec_button_idle_trans = sec_button_idle_obj.GetComponent <CompRectTransform>();

        //HUD ICON
        icon_trans  = icon_obj.GetComponent <CompRectTransform>();
        icon_img    = icon_obj.GetComponent <CompImage>();
        icon_hp_img = icon_hp_obj.GetComponent <CompImage>();
        if (icon_mana_obj != null)
        {
            icon_mana_img = icon_mana_obj.GetComponent <CompImage>();
        }
        if (icon_stamina_obj != null)
        {
            icon_stamina_img = icon_stamina_obj.GetComponent <CompImage>();
        }
    }
Beispiel #9
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            PageCommon.InitCommonPageElements(ref amCanvas);
            clearAll();

            for (int i = 0; i < 7; i++)
            {
                CompImage ci = new CompImage(i);

                ci.amBorder.Width  = 100;
                ci.amBorder.Height = 100;
                ci.amImage.Width   = 100;
                ci.amImage.Height  = 100;
                ci.Width           = 100;
                ci.Height          = 100;

                mImages.Add(ci);
            }

            mLayout = new LayoutSybSrh(this);
            mLayout.SetInstructionLayout();
            mStatus = STATUS.TITLE;

            this.Focus();

            //test belwow undefined
            //SybSrhItemGenerator ssg = new SybSrhItemGenerator();
            //while (true)
            //{
            //    List<SybSrhItem> items = ssg.Get12Items();
            //    bool ifpass = true;

            //    for(int k = 0; k < items.Count; k++)
            //    {
            //        for (int i = 0; i < items[k].Selection.Length; i++)
            //        {
            //            if (items[k].Selection[i] == null)
            //            {
            //                ifpass = false;
            //            }
            //        }

            //        if (!ifpass)
            //        {
            //            Console.WriteLine("not pass");
            //            ifpass = true;
            //        }
            //    }


            //}
        }
    public void Start()
    {
        black_bar_top = GetLinkedObject("black_bar_top");
        black_bar_bot = GetLinkedObject("black_bar_bot");

        black_bar_top_img = black_bar_top.GetComponent <CompImage>();
        black_bar_bot_img = black_bar_bot.GetComponent <CompImage>();

        black_bar_top_img.SetAlpha(0.0f);
        black_bar_bot_img.SetAlpha(0.0f);

        black_bars_state = BLACK_BARS_STATE.BBS_NONE;
    }
    // Use this for initialization
    void Start()
    {
        active        = false;
        broken_shield = false;

        shield_obj        = GetLinkedObject("shield_obj");
        broken_shield_obj = GetLinkedObject("broken_shield_obj");

        // Disable UI images
        icon = shield_obj.GetComponent <CompImage>();
        icon.SetEnabled(false);
        icon = broken_shield_obj.GetComponent <CompImage>();
        icon.SetEnabled(false);
    }
    void Update()
    {
        no_stamina.GetComponent <CompImage>().FillAmount(calc_stamina);
        if (!wasted_stamina)
        {
            if (curr_stamina < max_stamina)
            {
                curr_stamina += regen;
                if (curr_stamina > max_stamina)
                {
                    curr_stamina = max_stamina;
                }
                calc_stamina = curr_stamina / max_stamina;
                stamina_bar  = this_obj_stamina.GetComponent <CompImage>();
                stamina_bar.FillAmount(calc_stamina);
            }
        }
        else
        {
            wasted_stamina_time += Time.deltaTime;
            if (wasted_stamina_time >= wait_for_stamina_recovery)
            {
                wasted_stamina = false;
            }
        }

        if (not_enough_stamina)
        {
            flickering_time += Time.deltaTime;
            if (flickering_time >= stamina_flickering_time)
            {
                no_stamina.GetComponent <CompImage>().ActivateRender();
            }
            if (flickering_time >= stamina_flickering_time * 2)
            {
                no_stamina.GetComponent <CompImage>().DeactivateRender();
            }
            if (flickering_time >= stamina_flickering_time * 3)
            {
                no_stamina.GetComponent <CompImage>().ActivateRender();
            }
            if (flickering_time >= stamina_flickering_time * 4)
            {
                no_stamina.GetComponent <CompImage>().DeactivateRender();
                not_enough_stamina = false;
            }
        }
    }
Beispiel #13
0
    public void GetDamage(float dmg)
    {
        other_obj_hp.GetComponent <CompImage>().FillAmount(current_hp / max_hp);

        other_obj_hp.GetComponent <LeftHp>().current_lasthp       = current_hp;
        other_obj_hp.GetComponent <LeftHp>().hp_ready_to_below    = false;
        other_obj_hp.GetComponent <LeftHp>().current_temp_hp_time = 0.0f;
        other_obj_hp.GetComponent <LeftHp>().hp_bar_changed       = true;
        current_hp -= dmg;
        if (current_hp < 0)
        {
            current_hp = 0;
        }
        calc_hp = current_hp / max_hp;
        hp_bar  = this_obj_hp.GetComponent <CompImage>();
        hp_bar.FillAmount(calc_hp);
        other_obj_hp.GetComponent <LeftHp>().lasthp_value = current_hp;
    }
    public void DecreaseStamina(float cost)
    {
        //Costs are 0 in GOD MODE
        if (GetLinkedObject("player_obj").GetComponent <CharactersManager>().god_mode ||
            GetLinkedObject("player_obj").GetComponent <CharactersManager>().no_energy)
        {
            cost = 0;
        }

        other_bar_lastamina.GetComponent <Leftamina>().lastamina_value = curr_stamina;
        if (curr_stamina > cost)
        {
            curr_stamina -= cost;
        }
        calc_stamina = curr_stamina / max_stamina;
        stamina_bar  = this_obj_stamina.GetComponent <CompImage>();
        stamina_bar.FillAmount(calc_stamina);
        other_bar_lastamina.GetComponent <Leftamina>().stamina_bar_changed = false;
    }
Beispiel #15
0
        public void SetSelectionLayout()
        {
            mPage.clearAll();

            for (int i = 0; i < 7; i++)
            {
                CompImage ci = mPage.mImages[i];
                mPage.amCanvas.Children.Add(ci);

                if (i < 2)
                {
                    Canvas.SetLeft(ci,
                                   FEITStandard.PAGE_BEG_X +
                                   (FEITStandard.PAGE_WIDTH - COMP_SIDE_LEN * 2 - HORIZONTAL_GAP) /
                                   2 + i * (COMP_SIDE_LEN + HORIZONTAL_GAP));

                    Canvas.SetTop(ci, FEITStandard.PAGE_BEG_Y + 125);
                }
                else if (i >= 2 && i < 7)
                {
                    Canvas.SetLeft(ci,
                                   FEITStandard.PAGE_BEG_X +
                                   (FEITStandard.PAGE_WIDTH - COMP_SIDE_LEN * 5 - HORIZONTAL_GAP * 3) /
                                   2 + (i - 2) * (COMP_SIDE_LEN + HORIZONTAL_GAP));

                    Canvas.SetTop(ci, FEITStandard.PAGE_BEG_Y + 350);
                }
            }

            Rectangle rect = new Rectangle();

            rect.Height = 2;
            rect.Width  = 600;
            rect.Fill   = new SolidColorBrush(Color.FromRgb(255, 255, 255));
            rect.Stroke = new SolidColorBrush(Color.FromRgb(255, 255, 255));

            mPage.amCanvas.Children.Add(rect);
            Canvas.SetTop(rect, FEITStandard.PAGE_BEG_Y + 275);
            Canvas.SetLeft(rect, FEITStandard.PAGE_BEG_X +
                           (FEITStandard.PAGE_WIDTH - rect.Width) / 2);
        }
Beispiel #16
0
    public void DecreaseManaPercentage(float cost_percentage)
    {
        //Costs are 0 in GOD MODE
        if (GetLinkedObject("player_obj").GetComponent <CharactersManager>().god_mode ||
            GetLinkedObject("player_obj").GetComponent <CharactersManager>().no_energy)
        {
            cost_percentage = 0;
        }

        float cost = cost_percentage * max_mana / 100.0f;

        other_obj_lastmana.GetComponent <LeftMana>().lastmana_value = curr_mana;
        if (curr_mana > cost)
        {
            curr_mana -= cost;
        }
        calc_mana = curr_mana / max_mana;
        mana_bar  = this_obj_mana.GetComponent <CompImage>();
        mana_bar.FillAmount(calc_mana);
        other_obj_lastmana.GetComponent <LeftMana>().mana_bar_changed = false;
    }
Beispiel #17
0
 void Update()
 {
     finish_sprite = finish_stats.GetComponent <CompImage>();
 }
    public void SetHPBar(float hp_percentage)
    {
        CompImage hp_bar = gameObject.GetComponent <CompImage>();

        hp_bar.FillAmount(hp_percentage);
    }
 //Disable UI Image
 void DisableShield()
 {
     icon = broken_shield_obj.GetComponent <CompImage>();
     icon.SetEnabled(false);
 }
 //Enable UI Image
 void EnableBrokenShield()
 {
     icon = broken_shield_obj.GetComponent <CompImage>();
     icon.SetEnabled(true);
 }
Beispiel #21
0
 void FillComboBar(float time)
 {
     calc_time = time / max_time;
     combo_bar = this_combo_bar_obj.GetComponent <CompImage>();
     combo_bar.FillAmount(calc_time);
 }
 public virtual void Start()
 {
     button_cd          = GetComponent <CompButton>();
     fill_image         = GetComponent <CompImage>();
     characters_manager = GetLinkedObject("player_obj").GetComponent <CharactersManager>();
 }