コード例 #1
0
    public Sprite sprite; // Drag your first sprite here


    // Use this for initialization
    void Start()
    {
        cardDataBase    = GameObject.FindObjectOfType <Sc_CardDataBase>();
        battleManager   = GameObject.FindObjectOfType <Sc_BattleManager>();
        SpriteRenderer1 = GameObject.Find("DeckPile").GetComponent <SpriteRenderer>();
        SpriteRenderer3 = GameObject.Find("BanishPile").GetComponent <SpriteRenderer>();
        SpriteRenderer2 = GameObject.Find("DiscardPile").GetComponent <SpriteRenderer>();



        {
        }
        if (DeckType == 0)
        {
            SpriteRenderer1.sprite = sprite;
        }
        else if (DeckType == 1)
        {
            SpriteRenderer2.sprite = sprite;
        }
        else if (DeckType == 2)
        {
            SpriteRenderer3.sprite = sprite;
        }
    }
コード例 #2
0
    private void Update()
    {
        scene         = SceneManager.GetActiveScene();
        battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();
        gameManager   = GameObject.FindObjectOfType <Sc_GameManager>();
        navManager    = GameObject.FindObjectOfType <Sc_NavigationManager>();


/*
 *      if (Input.GetKeyDown(KeyCode.T) == true)
 *      {
 *
 *
 *
 *      }
 *      if (Input.GetKeyDown(KeyCode.S) == true)
 *      {
 *
 *
 *
 *          SaveGameData();
 *      }
 *
 *      if (Input.GetKeyDown(KeyCode.L) == true)
 *      {
 *          LoadGameData();
 *      }*/
    }
コード例 #3
0
ファイル: SO_CurseBomb.cs プロジェクト: Viezard/HovedOpgave
    public override void PlayedFunction()
    {
        Sc_BattleManager battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();

        battleManager.DamageCalc(target: 1, damage: monsterDamage);
        battleManager.DamageCalc(target: 0, damage: selfDamage);
    }
コード例 #4
0
 void Awake()
 {
     cardDataBase      = GameObject.FindObjectOfType <Sc_CardDataBase>();
     battleManager     = GameObject.FindObjectOfType <Sc_BattleManager>();
     render            = this.gameObject.GetComponent <SpriteRenderer>();
     defenceTextObject = this.gameObject.transform.GetChild(0).GetChild(1).gameObject;
     defenceText       = defenceTextObject.GetComponent <TextMesh>();
 }
コード例 #5
0
    void Start()
    {
        cardDataBase     = GameObject.FindObjectOfType <Sc_CardDataBase>();
        battleManager    = GameObject.FindObjectOfType <Sc_BattleManager>();
        endPointDiscardX = GameObject.Find("DiscardPile").transform.position.x;
        endPointDiscardY = GameObject.Find("DiscardPile").transform.position.y;


        endPointY = -4.4f;
        Sc_BattleManager.currentHandObjects.Add(this.gameObject);         // Add it to the array which holds all card objects
        placementInHand = Sc_BattleManager.currentHandObjects.Count;      // Saves is place in the array
        // Vector3 newPosition = new Vector3 (1.1f * placementInHand, 2.2f, 0); // Just places it the right place
        // this.transform.position = newPosition;


        // Set the background of the card
        background = this.gameObject.transform.GetChild(0).gameObject;
        SpriteRenderer backgroundSR = background.GetComponent <SpriteRenderer>();

        description      = this.gameObject.transform.GetChild(1).gameObject;
        banner           = this.gameObject.transform.GetChild(2).gameObject;
        leftIcon         = this.gameObject.transform.GetChild(3).gameObject;
        rightIcon        = this.gameObject.transform.GetChild(4).gameObject;
        leftBonusIconOne = this.gameObject.transform.GetChild(5).gameObject;
        leftBonusIconTwo = this.gameObject.transform.GetChild(6).gameObject;

        if (cardID < 1000)
        {
            SO_CardMelee card = cardDataBase.FindMeleeCardByID(cardID);
            apCost = card.apCost;
            backgroundSR.sprite = card.image;
            SetMeleeText();
        }
        else if (cardID < 2000)
        {
            SO_CardArmor card = cardDataBase.FindArmorCardByID(cardID);
            apCost = card.apCost;
            backgroundSR.sprite = card.image;
            SetArmorText();
        }
        else if (cardID < 3000)
        {
            CardUtility card = cardDataBase.FindUtilityCardByID(cardID);
            apCost = card.apCost;
            backgroundSR.sprite = card.image;
            SetUtilityText();
        }
        else if (cardID < 4000)
        {
            CardCurse card = cardDataBase.FindCurseCardByID(cardID);
            apCost = card.apCost;
            backgroundSR.sprite = card.image;
        }


        // Get other components
    }
コード例 #6
0
    public override void PlayedFunction()
    {
        Sc_BattleManager battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();

        battleManager.currentRage += rage;
        if (selfDamage != 0)
        {
            battleManager.DamageCalc(target: 0, damage: selfDamage);
        }
    }
コード例 #7
0
ファイル: Sc_MonsterName.cs プロジェクト: Viezard/HovedOpgave
 // Update is called once per frame
 void Update()
 {
     if (hasName == false)
     {
         battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();
         TextMesh text = this.GetComponent <TextMesh>();
         text.text = battleManager.monster.name;
         hasName   = true;
     }
 }
コード例 #8
0
ファイル: MonsterClass.cs プロジェクト: Viezard/HovedOpgave
    // Use this for initialization
    void Start()
    {
        battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();
        healthText    = GameObject.Find("Monster'sHealth").GetComponent <Text>();
        defenceText   = GameObject.Find("Monster'sDefence").GetComponent <Text>();


        healthText.text  = "" + health;
        defenceText.text = "" + defence;
        MonsterStart();
    }
コード例 #9
0
    public override void PlayedFunction()
    {
        Sc_BattleManager battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();
        int random = Random.Range(0, 100);

        if (chanceHitSelf <= random)
        {
            battleManager.DamageCalc(target: 1, damage: damage, poison: poison);
        }
        else
        {
            battleManager.DamageCalc(target: 0, damage: damage, poison: poison);
        }
    }
コード例 #10
0
ファイル: Sc_Log.cs プロジェクト: Viezard/HovedOpgave
    // Use this for initialization
    void Start()
    {
        battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();
        Update();
        placement = 0;
        for (int i = 0; i < battleManager.logBook.Count; i++)
        {
            Sc_Log newScript = battleManager.logBook[i].GetComponent <Sc_Log>();
            newScript.placement += 1;
        }
        Text thisText = this.gameObject.GetComponent <UnityEngine.UI.Text>();

        battleManager.logBook.Add(thisText);
    }
コード例 #11
0
ファイル: Sc_ApIcon.cs プロジェクト: Viezard/HovedOpgave
 // Use this for initialization
 void Start()
 {
     battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();
     gameManager   = GameObject.FindObjectOfType <Sc_GameManager>();
     spriteR       = this.gameObject.GetComponent <SpriteRenderer>();
     battleManager.apObjects.Add(this.gameObject);
     placement = battleManager.apObjects.Count - 1;
     // set starting spirte
     if (isStandard)
     {
         spriteR.sprite = standard;
     }
     else if (isUtility)
     {
         spriteR.sprite = utility;
     }
     else if (oneTime)
     {
         spriteR.sprite = oneTime;
     }
 }
コード例 #12
0
    // Use this for initialization
    void Start()
    {
        cardDataBase  = GameObject.FindObjectOfType <Sc_CardDataBase>();
        battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();
        SpriteRenderer render = this.gameObject.GetComponent <SpriteRenderer>();

        DiscardPile      = GameObject.Find("DiscardPile");
        endPointDiscardX = DiscardPile.transform.position.x;
        endPointDiscardY = DiscardPile.transform.position.y;


        if (id < 1000)
        {
            card = cardDataBase.FindMeleeCardByID(id);
        }
        render.sprite = card.image;
        battleManager.currentEquipmentMelee.Add(this.gameObject);                            // Add it to the array which holds all card objects
        placementInEquipent = battleManager.currentEquipmentMelee.Count;                     // Saves is place in the array
        Vector3 newPosition = new Vector3(-2f - 0.8f * (placementInEquipent - 1), -1.5f, 0); // Just places it the right place

        this.transform.position = newPosition;

        // Set the left Icon
        GameObject leftIconText  = this.gameObject.transform.GetChild(0).transform.GetChild(0).transform.GetChild(0).gameObject;
        TextMesh   leftIconTextR = leftIconText.GetComponent <TextMesh>();

        leftIconTextR.text = card.normalDamage + "";
        // Set the left bonus one icon
        bool isset = false;

        if (card.poisonDamage > 0)
        {
            isset = true;
            SpriteRenderer leftBonusIconOneR = this.gameObject.transform.transform.GetChild(0).GetChild(1).gameObject.GetComponent <SpriteRenderer>();
            leftBonusIconOneR.sprite = greenBanner;
            GameObject leftBonusIconOneText  = this.gameObject.transform.transform.GetChild(0).GetChild(1).transform.GetChild(0).gameObject.transform.GetChild(0).gameObject;
            TextMesh   leftBonusIconOneTextR = leftBonusIconOneText.GetComponent <TextMesh>();
            leftBonusIconOneTextR.text = card.poisonDamage + "";
        }
        else if (card.bluntDamage > 0)
        {
            isset = true;
            SpriteRenderer leftBonusIconOneR = this.gameObject.transform.GetChild(0).transform.GetChild(1).GetComponent <SpriteRenderer>();
            leftBonusIconOneR.sprite = grayBanner;
            GameObject leftBonusIconOneText  = this.gameObject.transform.GetChild(0).transform.GetChild(1).transform.GetChild(0).gameObject;
            TextMesh   leftBonusIconOneTextR = leftBonusIconOneText.GetComponent <TextMesh>();
            leftBonusIconOneTextR.text = card.bluntDamage + "";
        }
        else
        {
            Destroy(this.gameObject.transform.GetChild(0).transform.GetChild(1).gameObject);
        }
        // Set the left bonus two icon
        if (card.bluntDamage > 0 && isset == false)
        {
            isset = true;
            SpriteRenderer leftBonusIconOneR = this.gameObject.transform.GetChild(0).transform.GetChild(1).GetComponent <SpriteRenderer>();
            leftBonusIconOneR.sprite = grayBanner;
            GameObject leftBonusIconOneText  = this.gameObject.transform.GetChild(0).transform.GetChild(1).transform.GetChild(0).gameObject.transform.GetChild(0).gameObject;
            TextMesh   leftBonusIconOneTextR = leftBonusIconOneText.GetComponent <TextMesh>();
            leftBonusIconOneTextR.text = card.bluntDamage + "";
        }
        else
        {
            Destroy(this.gameObject.transform.transform.GetChild(0).GetChild(2).gameObject);
        }
    }
コード例 #13
0
    public override void PlayedFunction()
    {
        Sc_BattleManager battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();

        battleManager.ExtraAttacks(extraAttacks);
    }
コード例 #14
0
    public bool beforeOrAfter = false; // if false then you discard before you draw, if true you discard after
    public override void PlayedFunction()
    {
        Sc_BattleManager battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();

        battleManager.DrawCards(draw, discard, isRandom, beforeOrAfter);
    }
コード例 #15
0
    public override void PlayedFunction()
    {
        Sc_BattleManager battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();

        battleManager.Recycle(cardsToTake);
    }
コード例 #16
0
    public override void PlayedFunction()
    {
        Sc_BattleManager battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();

        battleManager.BonusAP(apBonus);
    }
コード例 #17
0
ファイル: Effect.cs プロジェクト: Viezard/HovedOpgave
 void Start()
 {
     battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();
     placement     = battleManager.currentEffects.Count;
     battleManager.currentEffects.Add(this.gameObject);
 }
コード例 #18
0
    public override void PlayedFunction()
    {
        Sc_BattleManager battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();

        battleManager.Buffing(toughness, spiked);
    }
コード例 #19
0
    public override void PlayedFunction()
    {
        Sc_BattleManager battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();

        battleManager.Debuff(decreaseDamage, chanceDecreaseDamage, cantHit, chanceCantHit, hitself, chancehitself);
    }
コード例 #20
0
    public override void PlayedFunction()
    {
        Sc_BattleManager battleManager = GameObject.FindObjectOfType <Sc_BattleManager>();

        battleManager.Healing(maxHealth, minHealth, chance);
    }