Пример #1
0
    public Dialogue GetDialogue(Ability.Type stage1Ability, bool call)
    {
        List <Ability.Type> abilityList = new List <Ability.Type> ();

        abilityList.Add(stage1Ability);
        return(GetDialogue(abilityList, call));
    }
Пример #2
0
    public GameObject GetPrefabFromAbilityType(Ability.Type type)
    {
        switch (type)
        {
        case Ability.Type.BasicAttack:
            return(basicAttack);

        case Ability.Type.Fireball:
            return(fireball);

        case Ability.Type.Lunge:
            return(lunge);

        case Ability.Type.Pull:
            return(pull);

        case Ability.Type.Shield:
            return(shield);

        case Ability.Type.Sing:
            return(sing);

        case Ability.Type.Wallop:
            return(wallop);

        case Ability.Type.Blink:
            return(blink);

        default:
            return(null);
        }
    }
Пример #3
0
    void InitializeUI()
    {
        cooldownBarDict = new Dictionary <Ability.Type, GameObject> ();
        for (int i = 0; i < cooldownUI_P1.Length - 1; i++)
        {
            GameObject obj_P1 = cooldownUI_P1[i];
            GameObject obj_P2 = cooldownUI_P2[i];
            if (i < Services.FightScene.roundNum)
            {
                GameObject   timer_P1   = obj_P1.transform.GetChild(0).gameObject;
                GameObject   timer_P2   = obj_P2.transform.GetChild(0).gameObject;
                GameObject   icon_P1    = obj_P1.transform.GetChild(1).gameObject;
                GameObject   icon_P2    = obj_P2.transform.GetChild(1).gameObject;
                Ability.Type ability_P1 = Services.GameInfo.player1Abilities[i];
                Ability.Type ability_P2 = Services.GameInfo.player2Abilities[i];

                icon_P1.GetComponent <Image>().sprite = spriteDict[ability_P1];
                icon_P2.GetComponent <Image>().sprite = spriteDict[ability_P2];

                cooldownBarDict.Add(ability_P1, timer_P1);
                cooldownBarDict.Add(ability_P2, timer_P2);
            }
            else
            {
                obj_P1.SetActive(false);
                obj_P2.SetActive(false);
            }
        }
    }
Пример #4
0
 public AbilityCooldownTask(Ability.Type ab, float dur, Player pl)
 {
     ability       = ab;
     duration      = dur;
     timeRemaining = dur;
     player        = pl;
 }
Пример #5
0
    public GameObject CreateAbilitySymbol(Ability.Type ability)
    {
        GameObject symbol = Instantiate(Services.PrefabDB.GenericImage, Services.VisualNovelScene.canvas.transform) as GameObject;

        symbol.GetComponent <Image>().sprite = spriteDict[ability];
        symbol.GetComponent <Image>().color  = Color.black;
        return(symbol);
    }
Пример #6
0
    void PickAbility(DialoguePicked e)
    {
        int playerNum = e.pickedByPlayerNum;

        Ability.Type ability = e.dialogue.abilityGiven;
        abilityLists[playerNum - 1].Add(ability);
        abilityPool.Remove(ability);
        currentRoundAbilityPool.Remove(ability);
        Services.TransitionUIManager.dialoguesAccumulated[playerNum - 1].Add(e.dialogue);
        Debug.Log(ability.ToString() + " picked");
    }
Пример #7
0
    public Ability GetAbilityOfType(Ability.Type type)
    {
        foreach (Ability ability in abilities)
        {
            if (ability.type == type)
            {
                return(ability);
            }
        }

        throw new System.Exception("Ability not found with type: " + type + " in ship: " + gameObject.name);
    }
Пример #8
0
    public void ScaleCooldownUI(Ability.Type ability, int playerNum, float scale)
    {
        Transform timerTransform = GetTimer(ability, playerNum).transform;

        timerTransform.localScale = scale * Vector3.one;
        if (scale == 1)
        {
            timerTransform.parent.GetChild(1).GetComponent <Image>().color = Color.black;
        }
        else
        {
            timerTransform.parent.GetChild(1).GetComponent <Image>().color = Color.white;
        }
    }
Пример #9
0
    public void SetPose()
    {
        GameObject          characterToPose;
        List <Ability.Type> abilityList = Services.VisualNovelScene.abilityLists[Services.VisualNovelScene.currentTurnPlayerNum - 1];

        Ability.Type abilityPicked = abilityList[abilityList.Count - 1];
        if (Services.VisualNovelScene.currentTurnPlayerNum == 1)
        {
            characterToPose = ponytail;
        }
        else
        {
            characterToPose = pigtails;
        }
        string animTrigger = poseTriggerDict[abilityPicked];

        characterToPose.GetComponent <Animator>().SetTrigger(animTrigger);
    }
Пример #10
0
    public void UpdateCooldownUI(Ability.Type ability, float fractionRemaining, int playerNum)
    {
        Image timerImage = GetTimer(ability, playerNum).GetComponent <Image>();
        float alpha;
        Color iconColor;

        timerImage.fillAmount = 1 - fractionRemaining;
        if (fractionRemaining > 0)
        {
            alpha     = 0.5f;
            iconColor = new Color(0.5f, 0.5f, 0.5f, 0.5f);
        }
        else
        {
            alpha     = 1;
            iconColor = Color.black;
        }
        timerImage.color = new Color(timerImage.color.r, timerImage.color.g, timerImage.color.b, alpha);
        timerImage.transform.parent.GetChild(1).GetComponent <Image>().color = iconColor;
    }
Пример #11
0
    GameObject GetTimer(Ability.Type ability, int playerNum)
    {
        GameObject timer;

        if (ability != Ability.Type.BasicAttack)
        {
            timer = cooldownBarDict[ability];
        }
        else
        {
            if (playerNum == 1)
            {
                timer = cooldownUI_P1[3].transform.GetChild(0).gameObject;
            }
            else
            {
                timer = cooldownUI_P2[3].transform.GetChild(0).gameObject;
            }
        }

        return(timer);
    }
Пример #12
0
    void DoAbility(Ability.Type type)
    {
        if (!abilitiesOnCooldown.Contains(type))
        {
            GameObject abilityObj = Instantiate(Services.PrefabDB.GetPrefabFromAbilityType(type),
                                                transform.position, Quaternion.identity) as GameObject;
            EndAbility();
            currentActiveAbility = abilityObj.GetComponent <Ability> ();
            Debug.Assert(currentActiveAbility != null);
            currentActiveAbility.Init(this);

            //CastAbilityTask castTimeLockout = new CastAbilityTask (currentActiveAbility.castDuration, this, currentActiveAbility);
            AbilityCooldownTask         abilityCooldown      = new AbilityCooldownTask(type, currentActiveAbility.cooldown, this);
            HighlightAbilityOffCooldown highlightCooldownEnd = new HighlightAbilityOffCooldown(type, this,
                                                                                               Services.FightUIManager.abCDHighlightTime);
            abilityCooldown.Then(highlightCooldownEnd);


            StopListeningForInput();
//			taskManager.AddTask (castTimeLockout);
            taskManager.AddTask(abilityCooldown);
        }
    }
Пример #13
0
 float DoAbility(Ability.Type ab)
 {
     if (ab == Ability.Type.BasicAttack)
     {
         return(BasicAttack());
     }
     else if (ab == Ability.Type.Fireball)
     {
         return(ThrowFireball());
     }
     else if (ab == Ability.Type.Lunge)
     {
         return(Lunge());
     }
     else if (ab == Ability.Type.Sing)
     {
         return(Sing());
     }
     else if (ab == Ability.Type.Shield)
     {
         return(Shield());
     }
     return(0f);
 }
 public HighlightAbilityOffCooldown(Ability.Type ab, Player pl, float dur)
 {
     ability = ab;
     player = pl;
     duration = dur;
 }
Пример #15
0
    public void SetPanel(int winningPlayerNum)
    {
        if (switchOnPersonality)
        {
            if (winningPlayerNum == 1)
            {
                Ability.Type ability = Services.GameInfo.player1Abilities[Services.GameInfo.player1Abilities.Count - 1];
                switch (ability)
                {
                case Ability.Type.Fireball:
                    image.sprite = ponytailFireballPanel;
                    break;

                case Ability.Type.Lunge:
                    image.sprite = ponytailLungePanel;
                    break;

                case Ability.Type.Sing:
                    image.sprite = ponytailSingPanel;
                    break;

                case Ability.Type.Shield:
                    image.sprite = ponytailShieldPanel;
                    break;

                case Ability.Type.Wallop:
                    image.sprite = ponytailWallopPanel;
                    break;

                case Ability.Type.Pull:
                    image.sprite = ponytailPullPanel;
                    break;

                case Ability.Type.Blink:
                    image.sprite = ponytailBlinkPanel;
                    break;

                default:
                    break;
                }
            }
            else
            {
                Ability.Type ability = Services.GameInfo.player2Abilities[Services.GameInfo.player2Abilities.Count - 1];
                switch (ability)
                {
                case Ability.Type.Fireball:
                    image.sprite = pigtailsFireballPanel;
                    break;

                case Ability.Type.Lunge:
                    image.sprite = pigtailsLungePanel;
                    break;

                case Ability.Type.Sing:
                    image.sprite = pigtailsSingPanel;
                    break;

                case Ability.Type.Shield:
                    image.sprite = pigtailsShieldPanel;
                    break;

                case Ability.Type.Wallop:
                    image.sprite = pigtailsWallopPanel;
                    break;

                case Ability.Type.Pull:
                    image.sprite = pigtailsPullPanel;
                    break;

                case Ability.Type.Blink:
                    image.sprite = pigtailsBlinkPanel;
                    break;

                default:
                    break;
                }
            }
        }
        else
        {
            if (winningPlayerNum == 1)
            {
                image.sprite = ponytailWinPanel;
            }
            else
            {
                image.sprite = pigtailsWinPanel;
            }
        }
    }
Пример #16
0
 public Dialogue(string mainTxt, string blurbTxt, Ability.Type ability)
 {
     mainText     = mainTxt;
     blurb        = blurbTxt;
     abilityGiven = ability;
 }