Ejemplo n.º 1
0
    public override void act(CardSystem cs, Land_[] lands)
    {
        float AddExplodeRate = Random.Range(min_rate, max_rate);

        for (int u = 0; u != lands.Length; ++u)
        {
            lands[u].tmp_delta_explode_rate = AddExplodeRate;
        }
    }
Ejemplo n.º 2
0
 private void Awake()
 {
     skillInfo     = FindObjectOfType <SkillInfo>();
     cardSystem    = FindObjectOfType <CardSystem>();
     getBarInfo    = FindObjectOfType <GetBarInfo>();
     turnSystem    = FindObjectOfType <TurnSystem>();
     damageHandler = FindObjectOfType <DamageHandler>();
     gridGenerator = FindObjectOfType <EditedGridGenerator>();
 }
Ejemplo n.º 3
0
 public override void act(CardSystem cs, Land_[] lands)
 {
     AddExplodeRate = Random.Range(min_rate, max_rate);
     event_msg      = "大地震發生!!!\n場地上爆炸機率增加" + ((int)(AddExplodeRate / 0.01f)).ToString() + "%";
     for (int u = 0; u != lands.Length; ++u)
     {
         lands[u].tmp_delta_explode_rate = AddExplodeRate;
     }
 }
Ejemplo n.º 4
0
    private void Start()
    {
        cardsystem   = GameObject.FindWithTag("CardSystem").GetComponent <CardSystem>();
        battleScript = GameObject.Find("BattleSystem").GetComponent <battleSystem>();

        Scene currentScene = SceneManager.GetActiveScene();

        sceneName = currentScene.name;
    }
Ejemplo n.º 5
0
    string generateEvent()
    {
        CardSystem cs = FindObjectOfType <CardSystem>();

        Land_[]  lands = FindObjectsOfType <Land_>();
        I_Event_ _eve  = getEvent();

        _eve.act(cs, lands);
        return(_eve.event_msg);
    }
Ejemplo n.º 6
0
 private void Awake()
 {
     turnSystem    = FindObjectOfType <TurnSystem>();
     getBarInfo    = FindObjectOfType <GetBarInfo>();
     gridGenerator = FindObjectOfType <EditedGridGenerator>();
     cardSystem    = FindObjectOfType <CardSystem>();
     skillInfo     = FindObjectOfType <SkillInfo>();
     allSkills     = FindObjectOfType <AllSkills>();
     getCardInfo   = GetComponent <GetCardInfo>();
 }
Ejemplo n.º 7
0
 void OnGameStart()
 {
     UIManager.Get().MsgOnScreen("游戏开始啦!");
     AudioManager.Get().PlayBGM("1");
     AudioManager.Get().PlaySound("GameMain/GameStart", 0.05f);
     CardSystem.Get().AddCard(new Slay());
     CardSystem.Get().AddCard(new BattleHorn());
     CardSystem.Get().AddCard(new HawkEye());
     CardSystem.Get().AddCard(new Purify());
 }
Ejemplo n.º 8
0
 public override void act(CardSystem cs, Land_[] lands)
 {
     for (int u = 0; u != lands.Length; ++u)
     {
         if (lands[u].get_risk() < rate_barrier)
         {
             lands[u].data[0].risk = 1.0f;
         }
     }
 }
Ejemplo n.º 9
0
 public void ReverseAnimation(Card card, float time)
 {
     card.ObjTransform.DOScaleX(0, time / 2).SetEase(Ease.Linear)
     .OnComplete(() =>
     {
         card.IsShapesActive();
         card.IsTextsActive();
         card.IsBack = !card.IsBack;
         card.SetBackgroundSprite(CardSystem.GetInstance().GetCardSprite(card.IsBack));
         card.ObjTransform.DOScaleX(1, time / 2).SetEase(Ease.Linear);
     });
 }
Ejemplo n.º 10
0
    private void Awake()
    {
        width            = (transform as RectTransform).rect.height;
        originalPosition = transform.position.y;
        CardSystem.Get().CardContent = Content;
        CardSystem.Get().SetCardsPanel(this);
        //Debug.Log(originalPosition);
        Vector3 po = transform.position;

        po.y = originalPosition - width * HideAmount;
        transform.position = po;
    }
 public override void act(CardSystem cs, Land_[] lands)
 {
     rate_barrier = Random.Range(min_rate, max_rate);
     event_msg    = "驚報!!水泥公司使用海砂!!\n爆炸機率" + ((int)(rate_barrier / 0.01f)).ToString() + "%以下土地房屋全毀";
     for (int u = 0; u != lands.Length; ++u)
     {
         if (lands[u].get_risk() < rate_barrier && lands[u].data.Count != 0)
         {
             lands[u].data[0].risk = 1.0f;
         }
     }
 }
Ejemplo n.º 12
0
    public IEnumerator WaitForAnim_Down()
    {
        while (CardSystem.Get().Busy())
        {
            yield return(new WaitForSeconds(0.5f));
        }
        yield return(new WaitForSeconds(0.5f));

        if (!OnMouse)
        {
            Anim_Down(1f);
        }
    }
 public override void act(CardSystem cs, Land_[] lands)
 {
     DestoryType = Random.Range(1, HouseTypeAmount + 1);
     event_msg   = "市府查獲無良建商\n含有" + getHousePhisicalName(DestoryType - 1) + "之土地建物全數摧毀";
     for (int u = 0; u != lands.Length; ++u)
     {
         for (int i = 0; i != lands[u].data.Count; ++i)
         {
             if (lands[u].data[i].type_id == DestoryType)
             {
                 lands[u].data[i].risk = 1.0f;
             }
         }
     }
 }
    public override void act(CardSystem cs, Land_[] lands)
    {
        int DestoryType = Random.Range(1, HOUSE_TYPE_AMOUNT);

        for (int u = 0; u != lands.Length; ++u)
        {
            for (int i = 0; i != lands[u].data.Count; ++i)
            {
                if (lands[u].data[i].type_id == DestoryType)
                {
                    lands[u].data[i].risk = 1.0f;
                    break;
                }
            }
        }
    }
Ejemplo n.º 15
0
    //public IEnumerator ReverseAnimation(Card card, float speed)
    //{
    //    float time = 0;
    //    bool isReverseAnim = false;
    //
    //    Vector3 cardScale = card.GetScale();
    //    Vector3 startScale = cardScale;
    //    Vector3 destScale = new Vector3(-cardScale.x,cardScale.y);
    //
    //    while (time < 1)
    //    {
    //        time += speed * Time.deltaTime;
    //
    //        cardScale = Vector3.Lerp(startScale, destScale, time);
    //        card.SetScale(cardScale);
    //
    //        if (time > 0.5f && isReverseAnim == false)
    //        {
    //            isReverseAnim = true;
    //            card.IsShapesActive();
    //            card.IsTextsActive();
    //
    //            card.IsBack = !card.IsBack;
    //            card.SetBackgroundSprite(CardSystem.GetInstance().GetCardSprite(card.IsBack));
    //        }
    //
    //        yield return null;
    //    }
    //
    //    yield return null;
    //}

    public IEnumerator SinAnimation(List <Card> cards)
    {
        WaitForSeconds delay = new WaitForSeconds(5);

        yield return(delay);

        delay = new WaitForSeconds(0.1f);

        for (int i = 0; i < cards.Count; i++)
        {
            cards[i].transform.DOMove(new Vector3(
                                          Mathf.Sin((360 / cards.Count + 1) * i * Mathf.Deg2Rad) * 5,
                                          Mathf.Cos((360 / cards.Count + 1) * i * Mathf.Deg2Rad) * 5), 5);

            yield return(delay);
        }

        delay = new WaitForSeconds(2);
        yield return(delay);

        StartCoroutine(CardSystem.GetInstance().AllCardReverse());
    }
Ejemplo n.º 16
0
    private void Awake()
    {
        cardSystem    = FindObjectOfType <CardSystem>();
        gridGenerator = FindObjectOfType <EditedGridGenerator>();
        index         = (int)status;

        getStats = FindObjectsOfType <GetStats>();
        foreach (GetStats getStat in getStats)
        {
            if (currentTurn != cardSystem.Player.GetComponent <GetStats>())
            {
                if (getStat != cardSystem.Player.GetComponent <GetStats>())
                {
                    getStat.character.relation = RelationType.Friendly;
                }
                else
                {
                    getStat.character.relation = RelationType.Enemy;
                }
            }
            else if (currentTurn == cardSystem.Player.GetComponent <GetStats>())
            {
                if (getStat == cardSystem.Player.GetComponent <GetStats>())
                {
                    getStat.character.relation = RelationType.Friendly;
                }
                else
                {
                    getStat.character.relation = RelationType.Enemy;
                }
            }
        }

        SetOrder();
        RefreshOrder();
    }
Ejemplo n.º 17
0
 public void AddCard()
 {
     CardSystem.Get().AddCard(new Slay());
 }
Ejemplo n.º 18
0
 // Start is called before the first frame update
 void Start()
 {
     cardSystem  = CardSystem.instance;
     enemySystem = EnemySystem.instance;
 }
Ejemplo n.º 19
0
 private void UpdateCardInfo(CardSystem.Card card)
 {
     if (cards[cardToUse] == "")
     {
         currentCardName.text = "None";
     }
     else
     {
         currentCardName.text = cardToUse+1 >= MAX_HAND ? "None" : cards[cardToUse+1];
         hand[cardToUse].transform.GetChild(CHILD_IMAGE_INDEX).GetComponent<Image>().sprite = null;
         hand[cardToUse].transform.GetChild(CHILD_IMAGE_INDEX).GetComponent<Image>().color = Color.black;
         hand[cardToUse].color = new Color(128.0f / 255, 128.0f / 255, 128.0f / 255);
     }
     cardToUse++;
 }
    private void Start()
    {
        cardsystem = GameObject.Find("CardSystem").GetComponent <CardSystem>();
        cardsystem.CardDescription.gameObject.SetActive(false);

        battleSystem = battlesystm.GetComponent <battleSystem>();

        cardType.text = CardName;



        if (PlayerHPVal == 0)
        {
            PlayerHPValtxt.enabled = false;
            //turn icon off? will have to make public image and redo cards
        }
        else
        {
            if (PlayerHPVal > 0)
            {
                PlayerHPValtxt.text = "+" + PlayerHPVal;
            }
            else
            {
                PlayerHPValtxt.text = "" + PlayerHPVal;
            }
        }

        if (PlayerAtkModVal == 0)
        {
            PlayerAtkModValtxt.enabled = false;
            //turn icon off? will have to make public image and redo cards
        }
        else
        {
            if (PlayerAtkModVal > 0)
            {
                PlayerAtkModValtxt.text = "+" + PlayerAtkModVal;
            }
            else
            {
                PlayerAtkModValtxt.text = "" + PlayerAtkModVal;
            }
        }

        if (PlayerDefModVal == 0)
        {
            PlayerDefModValtxt.enabled = false;
            //turn icon off? will have to make public image and redo cards
        }
        else
        {
            if (PlayerDefModVal > 0)
            {
                PlayerDefModValtxt.text = "+" + PlayerDefModVal;
            }
            else
            {
                PlayerDefModValtxt.text = "" + PlayerDefModVal;
            }
        }

        if (EnemyHPVal == 0)
        {
            EnemyHPValtxt.enabled = false;
            //turn icon off? will have to make public image and redo cards
        }
        else
        {
            if (EnemyHPVal > 0)
            {
                EnemyHPValtxt.text = "+" + EnemyHPVal;
            }
            else
            {
                EnemyHPValtxt.text = "" + EnemyHPVal;
            }
        }

        if (EnemyAtkModVal == 0)
        {
            EnemyAtkModValtxt.enabled = false;
            //turn icon off? will have to make public image and redo cards
        }
        else
        {
            if (EnemyAtkModVal > 0)
            {
                EnemyAtkModValtxt.text = "+" + EnemyAtkModVal;
            }
            else
            {
                EnemyAtkModValtxt.text = "" + EnemyAtkModVal;
            }
        }

        if (EnemyDefModVal == 0)
        {
            EnemyDefModValtxt.enabled = false;
            //turn icon off? will have to make public image and redo cards
        }
        else
        {
            if (EnemyDefModVal > 0)
            {
                EnemyDefModValtxt.text = "+" + EnemyDefModVal;
            }
            else
            {
                EnemyDefModValtxt.text = "" + EnemyDefModVal;
            }
        }
    }
Ejemplo n.º 21
0
 private void Awake()
 {
     instance  = this;
     readyFlag = false;
 }
Ejemplo n.º 22
0
 public override void act(CardSystem cs, Land_[] lands)
 {
     AddCardAmount = Random.Range(1, 3);
     event_msg     = "台灣發大財!!!\n所有玩家增加" + AddCardAmount.ToString() + "張手卡";
     cs.EveryBodyDraw(AddCardAmount);
 }
Ejemplo n.º 23
0
 public virtual void act(CardSystem cs, Land_[] lands)
 {
 }
Ejemplo n.º 24
0
 private void UpdateCardInfo(CardSystem.Card card, int playerIndex)
 {
     if (playerIndex != thisPlayerIndex) return;
     if (cards[cardToUse] == "")
     {
         currentCardName.text = "None";
     }
     else
     {
         currentCardName.text = cardToUse+1 >= MAX_HAND ? "None" : cards[cardToUse+1];
         hand[cardToUse].transform.GetChild(CHILD_IMAGE_INDEX).GetComponent<Image>().sprite = null;
         hand[cardToUse].transform.GetChild(CHILD_IMAGE_INDEX).GetComponent<Image>().color = Color.black;
         hand[cardToUse].color = CustomColor.Convert255(128.0f, 128.0f, 128.0f);
     }
     cardToUse++;
 }
 private void Start()
 {
     cardsystem = GameObject.Find("CardSystem").GetComponent <CardSystem>();
 }
Ejemplo n.º 26
0
 void Start()
 {
     f_CardInter_  = prefab_Card_.transform.GetChild(1).GetComponent <Image>().rectTransform.sizeDelta.x / 4;
     m_CardSystem_ = GameObject.Find("CardSystem").GetComponent <CardSystem>();
 }
Ejemplo n.º 27
0
    void Start()
    {
        GameManager.GetInstance().FadeOutWhiteImg(0.5f);

        CardSystem.GetInstance().AddAllCard();
        CardSystem.GetInstance().SetCardActive(true);

        CardSystem.GetInstance().AllCardMoveDeck(DeckSystem.GetInstance().GetDeck(DeckTag.ANIMATION_RIGHT_DECK));

        AiSystem.GetInstance().SetupOneCardAi();

        if (PlayerSystem.GetInstance().Players.Count <= 0)
        {
            PlayerSystem.GetInstance().MyPlayerId = "1";
            PlayerSystem.GetInstance().AddPlayer(PlayerTag.PLAYER_BOTTOM, "1", false);
            PlayerSystem.GetInstance().AddPlayer(PlayerTag.PLAYER_LEFT_DOWN, "3", true);
            PlayerSystem.GetInstance().AddPlayer(PlayerTag.PLAYER_TOP, "2", true);
            PlayerSystem.GetInstance().AddPlayer(PlayerTag.PLAYER_RIGHT_UP, "4", true);

            TurnSystem.GetInstance().AddTurnPlayer("1");
            TurnSystem.GetInstance().AddTurnPlayer("2");
            TurnSystem.GetInstance().AddTurnPlayer("3");
            TurnSystem.GetInstance().AddTurnPlayer("4");


            //NetworkSystem.GetInstance().SendServer("FIND-ROOM:" + "1");
        }

        StartCoroutine(StartScene());

        this.UpdateAsObservable()
        .Subscribe(_ =>
        {
            if (!GameManager.GetInstance().IsStartGame)
            {
                return;
            }

            var nowId = TurnSystem.GetInstance().PlayerNowTurn.Value;

            if (nowId == PlayerSystem.GetInstance().MyPlayerId)
            {
                InputSystem.GetInstance().TouchUpdate();
            }
        });

        TurnSystem.GetInstance().PlayerNowTurn.Subscribe(name =>
        {
            if (name == "")
            {
                return;
            }

            if (PlayerSystem.GetInstance().GetPlayer(name).IsAi)
            {
                AiSystem.GetInstance().IsStartAi.Value = true;
            }

            if (name == PlayerSystem.GetInstance().MyPlayerId)
            {
                OnTurnEndBtn();
            }
        });

        TurnSystem.GetInstance().IsFinishTurn.Subscribe(finish =>
        {
            if (!GameManager.GetInstance().IsStartGame)
            {
                return;
            }

            if (finish)
            {
                Observable.Timer(TimeSpan.FromSeconds(1))
                .Subscribe(_ =>
                {
                    if (GameManager.GetInstance().CheckDefeatPlayer())
                    {
                        return;
                    }

                    if (GameManager.GetInstance().CheckWinPlayer())
                    {
                        return;
                    }

                    GameManager.GetInstance().FillDecktoDeckofAttack(DeckTag.PUT_DECK, DeckTag.DRAW_DECK);
                });
            }
        });
    }
Ejemplo n.º 28
0
 public override void act(CardSystem cs, Land_[] lands)
 {
     //remain add feture
 }