Exemple #1
0
        private void FoundTown(MapElementInfo info, NVector pos, string townName, string coat, bool kill)
        {
            if (kill)
            {
                info.Kill();
            }

            int tid = S.Towns().Create(townName, pos);

            S.Town(tid).coat = coat;
            OnMapUI.Get().UpdatePanel(pos);
            S.ActPlayer().UpdateButtonMenu();
        }
Exemple #2
0
        protected override void Perform(ActionEvent evt, Player player, MapElementInfo info, NVector pos,
                                        ActionHolder holder)
        {
            //dying?
            if (holder.trigger == ActionEvent.NextRound)
            {
                info.Kill();
                info.AddNoti(S.T("destroyDie", info.name), DataAction().Icon);
                return;
            }

            WindowPanelBuilder wpb = WindowPanelBuilder.Create(S.T("destroyKill", info.name));

            wpb.panel.AddImageTextButton(S.T("destroyKill", info.name), info.Sprite(), (() =>
            {
                info.Kill();
                OnMapUI.Get().UpdatePanel(info.Pos());
                wpb.Close();
            }));
            wpb.AddClose();
            wpb.Finish();
        }
Exemple #3
0
        protected override void Perform(ActionEvent evt, Player player, MapElementInfo info, NVector pos,
                                        ActionHolder holder)
        {
            var i = SplitHelper.Split(holder.data["improvement"]);

            //set improvement
            L.b.improvements.Set(i.key, pos);

            //kill?
            if (i.value == "kill")
            {
                info.Kill();
            }
        }
Exemple #4
0
        protected override void Perform(ActionEvent evt, Player player, MapElementInfo info, NVector pos,
                                        ActionHolder holder)
        {
            var unit = S.Unit().At(pos);
            var town = unit.Town();

            if (!CreateBonus(player, info, pos, town))
            {
                return;
            }

            //get some wood
            if (town != null)
            {
                int a = Random.Range(2, 5);
                var i = L.b.res["wood"];
                player.info.Add(new Info(S.T("chestGenWood", a), i.Icon).CameraMove(pos));
                town.AddRes(i.id, a, ResType.Gift);
            }

            info.Kill();
            OnMapUI.Get().UpdatePanel(pos);
        }