Beispiel #1
0
    void OnCollisionEnter2D(Collision2D collision)
    {
        //Debug.Log (transform.tag+" "+transform.name+"COLLISION WITH: "+collision.transform.tag);
        //Debug.Log ("Player: "+player.name);
        //Debug.Log (""+collision.gameObject.GetComponentInParent<Transform>().gameObject.name);

        if (collision.transform.tag != transform.tag && collision.transform.tag != player.tag && collision.transform.tag.Contains("Player"))
        {
            Debug.Log("TREFFER!" + collision.transform.name + " " + collision.transform.tag);
            StatusControl status = collision.transform.GetComponent <PlatformerCharacter2D> ().statusScript;
            if (status != null)
            {
                Debug.Log("DAMAGE!: " + damage);
                if (!status.subHealth(damage))
                {
                    collision.transform.GetComponent <PlatformerCharacter2D> ().die();
                }
            }
            Destroy(gameObject);
        }
        else if (collision.transform.tag.Equals("Shield"))
        {
            Debug.Log("SHIELD!");
        }
        else if (collision.transform.tag != player.tag)
        {
            Destroy(gameObject);
        }
    }
Beispiel #2
0
        private void Launcher_Load(object sender, EventArgs e)
        {
            this.statusControl = new StatusControl();

            this.controlsPanel.Controls.Add(this.statusControl);
            this.backgroundWorker.RunWorkerAsync();
        }
Beispiel #3
0
        public FeatureFactory AddRadioSelectList(SortedDictionary <string, double> textOptions, ControlLocation location = null, EControlUse controlUse = EControlUse.NotSpecified)
        {
            if (textOptions == null)
            {
                throw new ArgumentNullException(nameof(textOptions));
            }

            foreach (var textOption in textOptions)
            {
                if (_feature.HasControlForValue(textOption.Value))
                {
                    throw new ArgumentException($"The value {textOption.Value} already has a control bound to it.", nameof(textOptions));
                }

                //TODO radio select list location
                var dropDownOption = new StatusControl(EControlType.RadioOption)
                {
                    TargetValue = textOption.Value,
                    Label       = textOption.Key,
                    ControlUse  = controlUse,
                    Location    = location ?? new ControlLocation()
                };
                _feature.AddStatusControl(dropDownOption);
            }

            return(this);
        }
Beispiel #4
0
        public Editor(TrueTypeFont font)
        {
            Font = font;

            Buffer  = new EditorBuffer();
            Options = new EditorOptions
            {
                HighlightCurrentLine = true,
                TabSize = 2
            };

            Hotkeys      = new List <Hotkey>();
            TextRenderer = new TextRenderer(this);
            Window       = new Window(this);

            ModeLine = new ModeLine(Font);
            Cursor   = new Cursor
            {
                ForceVisible = true
            };

            _ = new FileSystem(this);
            _ = new Modification(this);
            _ = new Navigation(this);
            _ = new StatusControl(this);
        }
Beispiel #5
0
        internal void RemoveStatusControl(StatusControl statusControl)
        {
            var currentStatusControls = _statusControls ?? new StatusControlCollection();

            if (Changes.ContainsKey(EProperty.StatusControls))
            {
                currentStatusControls = Changes[EProperty.StatusControls] as StatusControlCollection ?? new StatusControlCollection();
            }

            currentStatusControls.Remove(statusControl);

            if (Changes.ContainsKey(EProperty.StatusControls))
            {
                Changes[EProperty.StatusControls] = currentStatusControls;
            }
            else
            {
                Changes.Add(EProperty.StatusControls, currentStatusControls);
            }

            if (_cacheChanges)
            {
                return;
            }

            _statusControls = currentStatusControls;
        }
Beispiel #6
0
    // Update is called once per frame
    void Update()
    {
        if (attackList.Count > 0 && canAttack)
        {
            try{
                StatusControl sc = attackList[0].GetComponent <StatusControl>();
                if (sc.battelStatus != BattelStatus.DEAD)
                {
                    switch (attackList[0].layer)
                    {
                    case 8:
                        JobBase jb = attackList[0].GetComponent <JobBase>();
                        jb.skillUsing.skillMethod(jb.skillUsing, jb._target, jb.skillUsing.s_effectTime);
                        break;

                    case 12:
                        EnemyBase eb = attackList[0].GetComponent <EnemyBase>();
                        eb.skillUsing.skillMethod(eb._target, eb.skillUsing.s_effectTime);
                        break;
                    }
                    canAttack = false;
                }
                else
                {
                    ReadyNextAttack();
                }
            }
            catch (MissingReferenceException) {
                ReadyNextAttack();
            }
        }
    }
 public void DestroyControl(Control control)
 {
     if (_statusControl == control)
     {
         _statusControl = null;
     }
 }
Beispiel #8
0
 public DataAccess()
 {
     autentification = new Autentefication();
     projectControl  = new ProjectControl();
     taskControl     = new TaskControl();
     commentControl  = new CommentControl();
     accountControl  = new AccountControl();
     statusControl   = new StatusControl();
     historyControl  = new HistoryControl();
 }
Beispiel #9
0
 public static void StartCombat(Player player, Monster monster)
 {
     _player               = player;
     playerStatusC         = new StatusControl(_player);
     _monster              = monster;
     monsterStatusC        = new StatusControl(_monster);
     _player.Status.Weaken = 2;
     //_player.Status.Fury = 1;
     NewTurn();
     //ResetPlayer();
     //playerStatusC.HasTurnStart();
     //playerStatusC.ActivateStatus();
     //monsterStatusC.HasTurnStart();
     //monsterStatusC.ActivateStatus();//Old new turn stuff...
 }
Beispiel #10
0
        public PricerSheet(Worksheet sheet)
            : base(sheet)
        {
            _status = ControlRoot.AddControl(new StatusControl(sheet.Range["I4"], 10, 1, 6));
            ControlRoot.UnhandledException += ex =>
            {
                _status.Append(ex);
                // TODO: _log.Warn(ex);
            };

            var marketSettings = ControlRoot.AddControl(new PropertyGridControl(sheet.Range["B3"]));

            var market = new DropDownSelector {
                Values = new[] { "Live", "Close" }.ToReadOnly(), SelectedValue = "Live"
            };
            var valuationDate = new DateEditorControl {
                Value = Today
            };

            System.Action onMarketChanged = () => valuationDate.IsDisabled = market.SelectedValue == "Live";
            market.SelectedValueChanged += onMarketChanged;
            onMarketChanged();

            marketSettings.AddProperty("Valuation Date", valuationDate);
            marketSettings.AddProperty("Market", market);

            var trades = new List <TradeRowView>();

            trades.Add(new FXForwardRowView
            {
                Domestic       = { Value = Eur(10000) },
                Foreign        = { Value = Usd(12000) },
                SettlementDate = { Value = Today.AddMonths(3) },
                ForwardRate    = { Value = 1.2m }
            });

            trades.Add(new FXVanillaOptionRowView
            {
                Domestic       = { Value = Rub(10000) },
                Foreign        = { Value = Sgd(-12000) },
                SettlementDate = { Value = Today.AddMonths(6) },
                Strike         = { Value = 1.4m }
            });

            var tradeArea = ControlRoot.AddControl(new DynamicDataGridControl(sheet.Range["B15"], trades));

            tradeArea.AddColumns(new[] { "Settlement Date", "Domestic" });
        }
Beispiel #11
0
 public ControlsStore(
     MainForm mainForm,
     ProxySettingsControl proxySettingsControl,
     TargetControl targetControl,
     AttackOptionsControl attackOptionsControl,
     WorkersControl workersControl,
     StatusControl statusControl,
     TabPage tabAttackOptions
     )
 {
     MainForm             = mainForm;
     ProxySettingsControl = proxySettingsControl;
     TargetControl        = targetControl;
     AttackOptionsControl = attackOptionsControl;
     WorkersControl       = workersControl;
     StatusControl        = statusControl;
     TabAttackOptions     = tabAttackOptions;
 }
Beispiel #12
0
        /// <summary>
        /// Add a color picker control to the feature
        /// </summary>
        /// <remarks>
        /// Color pickers do not use the value of the feature to operate. They use a control string;
        ///  so the <see cref="targetValue"/> is superficial and does not correspond to the actual selected color.
        /// </remarks>
        /// <param name="targetValue">The value this control occupies on the feature.</param>
        /// <param name="location">The location of the control in the grid</param>
        /// <param name="controlUse">The specific use for this control</param>
        /// <returns>A FeatureFactory with the new color control added</returns>
        /// <exception cref="ArgumentException">Thrown when a control, targeting the specified value, already exists</exception>
        public FeatureFactory AddColorPicker(double targetValue, ControlLocation location = null, EControlUse controlUse = EControlUse.NotSpecified)
        {
            if (_feature.HasControlForValue(targetValue))
            {
                throw new ArgumentException($"The value {targetValue} already has a control bound to it.", nameof(targetValue));
            }

            var colorPicker = new StatusControl(EControlType.ColorPicker)
            {
                TargetValue = targetValue,
                ControlUse  = controlUse,
                Location    = location ?? new ControlLocation()
            };

            _feature.AddStatusControl(colorPicker);

            return(this);
        }
Beispiel #13
0
        /// <summary>
        /// Add a color picker control to the feature
        /// </summary>
        /// <remarks>
        /// Color pickers do not use the value of the feature to operate. They use a control string;
        ///  so the <see cref="targetRange"/> is superficial and does not correspond to the actual selected color.
        /// </remarks>
        /// <param name="targetRange">The values this control occupies on the feature.</param>
        /// <param name="location">The location of the control in the grid</param>
        /// <param name="controlUse">The specific use for this control</param>
        /// <returns>A FeatureFactory with the new color control added</returns>
        /// <exception cref="ArgumentException">Thrown when a control, targeting the specified value, already exists</exception>
        public FeatureFactory AddColorPicker(ValueRange targetRange, ControlLocation location = null, EControlUse controlUse = EControlUse.NotSpecified)
        {
            if (_feature.HasControlForRange(targetRange))
            {
                throw new ArgumentException($"Some or all of the values in the range {targetRange.Min}-{targetRange.Max} already has a control bound to it.", nameof(targetRange));
            }

            var colorPicker = new StatusControl(EControlType.ColorPicker)
            {
                TargetRange = targetRange,
                IsRange     = true,
                ControlUse  = controlUse,
                Location    = location ?? new ControlLocation()
            };

            _feature.AddStatusControl(colorPicker);

            return(this);
        }
Beispiel #14
0
 private void Awake()
 {
     Instance   = this;
     PhotonView = GetComponent <PhotonView>();
     turn       = 1;
     if (PhotonNetwork.isMasterClient)
     {
         active          = true;
         MaxActionPoints = 3;
         count           = 1;
         ActionPoints    = MaxActionPoints;
     }
     else
     {
         MaxActionPoints = 4;
         ActionPoints    = MaxActionPoints;
     }
     UnitRemaining = GameManager.Instance.MainTypeUnit.Count;
 }
Beispiel #15
0
        public FeatureFactory AddValueDropDown(ValueRange targetRange, ControlLocation location = null, EControlUse controlUse = EControlUse.NotSpecified)
        {
            if (targetRange == null)
            {
                throw new ArgumentNullException(nameof(targetRange));
            }

            if (_feature.HasControlForRange(targetRange))
            {
                throw new ArgumentException($"Some or all of the values in the range {targetRange.Min}-{targetRange.Max} already has a control bound to it.", nameof(targetRange));
            }

            var dropDown = new StatusControl(EControlType.ValueRangeDropDown)
            {
                TargetRange = targetRange,
                ControlUse  = controlUse,
                Location    = location ?? new ControlLocation()
            };

            _feature.AddStatusControl(dropDown);

            return(this);
        }
Beispiel #16
0
    void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.collider.gameObject.GetComponents <RespawnScript>() == null)
        {
            return;
        }

        if (collision.collider.gameObject.tag.StartsWith("Player") && collision.collider.gameObject.GetComponents <RespawnScript>() != null)
        {
            //UpdatePlayer
            StatusControl script = collision.collider.gameObject.GetComponent <PlatformerCharacter2D>().statusScript;
            if (script != null)
            {
                script.addEnergy(energyValue);
            }

            gameObject.GetComponent <AudioSource>().Play();

            //Number stuff
            controller.maxBalls++;
            Destroy(gameObject);
        }
    }
Beispiel #17
0
        public FeatureFactory AddNumberInputField(double targetValue, string hintText, ControlLocation location = null, EControlUse controlUse = EControlUse.NotSpecified)
        {
            if (string.IsNullOrWhiteSpace(hintText))
            {
                throw new ArgumentNullException(nameof(hintText));
            }

            if (_feature.HasControlForValue(targetValue))
            {
                throw new ArgumentException($"The value {targetValue} already has a control bound to it.", nameof(targetValue));
            }

            var numInput = new StatusControl(EControlType.TextBoxNumber)
            {
                TargetValue = targetValue,
                Label       = hintText,
                ControlUse  = controlUse,
                Location    = location ?? new ControlLocation()
            };

            _feature.AddStatusControl(numInput);

            return(this);
        }
Beispiel #18
0
        //Add Controls

        public FeatureFactory AddButton(double targetValue, string targetStatus, ControlLocation location = null, EControlUse controlUse = EControlUse.NotSpecified)
        {
            if (string.IsNullOrWhiteSpace(targetStatus))
            {
                throw new ArgumentNullException(nameof(targetStatus));
            }

            if (_feature.HasControlForValue(targetValue))
            {
                throw new ArgumentException($"The value {targetValue} already has a control bound to it.", nameof(targetValue));
            }

            var button = new StatusControl(EControlType.Button)
            {
                TargetValue = targetValue,
                Label       = targetStatus,
                ControlUse  = controlUse,
                Location    = location ?? new ControlLocation()
            };

            _feature.AddStatusControl(button);

            return(this);
        }
Beispiel #19
0
    public void StopGameCall()
    {
        //this is in case all the Neutral cells died
        if (NeutralFlock.GetComponent <Flock>().agents.Count == 0)
        {
            GetCurrentCellNumbers();
            endGame = true;
            lose    = true;
        }

        //this is in case all the good cells died
        if (GoodFlock.GetComponent <Flock>().agents.Count == 0)
        {
            // this first if is checking if the player is still wining without the Good cells
            if (BadFlock.GetComponent <Flock>().agents.Count > NeutralFlock.GetComponent <Flock>().agents.Count)
            {
                //if he is not winning the timer will start
                timer -= Time.deltaTime;
            }

            //in case the player wins without the good cells
            if (BadFlock.GetComponent <Flock>().agents.Count == 0)
            {
                GetCurrentCellNumbers();
                endGame = true;
                win     = true;
            }

            // when the timer runs out
            if (timer <= 0)
            {
                GetCurrentCellNumbers();
                endGame = true;
                lose    = true;
            }
        }


        //this is in case all the Bad cells died
        if (BadFlock.GetComponent <Flock>().agents.Count == 0)
        {
            if (GoodHuntVar >= StatusControl.GetHuntVar()) //last stand is true
            {
                lastStand = true;

                if (GoodFlock.GetComponent <Flock>().agents.Count == 0)
                {
                    GetCurrentCellNumbers();
                    endGame = true;
                    win     = true;
                }
                else if (NeutralFlock.GetComponent <Flock>().agents.Count == 0)
                {
                    GetCurrentCellNumbers();
                    endGame = true;
                    lose    = true;
                }
            }
            else //last stand is false
            {
                if (NeutralFlock.GetComponent <Flock>().agents.Count > GoodFlock.GetComponent <Flock>().agents.Count)
                {
                    GetCurrentCellNumbers();
                    endGame = true;
                    win     = true;
                }
                else if (NeutralFlock.GetComponent <Flock>().agents.Count < GoodFlock.GetComponent <Flock>().agents.Count)
                {
                    GetCurrentCellNumbers();
                    // the line of code below might change to a "partial win scenario" later
                    endGame = true;
                    win     = true;
                }
            }
        }
    }
 public Control MakeControl()
 {
     _statusControl = new StatusControl(this);
     _statusControl.Update();
     return(_statusControl);
 }
Beispiel #21
0
 void Start()
 {
     statusScript   = gameObject.GetComponent <PlatformerCharacter2D> ().statusScript;
     controlsScript = gameObject.GetComponent <Platformer2DUserControl>();
 }
Beispiel #22
0
 public void setStatusControl(GameObject statusControl)
 {
     Debug.Log("StatusControl");
     this.statusControl = statusControl;
     this.statusScript  = statusControl.GetComponent <StatusControl>();
 }
Beispiel #23
0
    /// <summary>
    /// Magic Damage the specified target
    /// </summary>
    /// <param name="target">Target.</param>
    /// <param name="skill">Skill.</param>
    /// <param name="time">攻撃のタイミング.</param>
    public IEnumerator MagicDamage(GameObject target, Skill skill, float a_time, string effect, float e_time)
    {
        if (skill.s_range > 0)
        {
            CreateRange();
            GameObject.FindGameObjectWithTag("Range").GetComponent <SphereCollider>().radius = skill.s_range;
        }
        float timer    = 0;
        bool  useMagic = false;

        while (true)
        {
            try
            {
                timer += Time.deltaTime;
                if (timer >= a_time && !useMagic)
                {
                    GameObject effectObj = Instantiate(Resources.Load(effect), target.transform.position, Quaternion.identity) as GameObject;
                    effectObj.transform.parent = this.transform;
                    useMagic = true;
                }
                if (timer >= e_time)
                {
                    float s_power = 1;                          //精霊の力
                    if (CheckFlag(ConditionStatus.MAGIC_UP))
                    {
                        s_power = 1.5f;
                    }
                    if (skill.s_range > 0)
                    {
                        foreach (var r_target in GameObject.FindGameObjectWithTag("Range").GetComponent <RangeDetect>().targets)
                        {
                            if (r_target.layer != LayerMask.NameToLayer("Player"))
                            {
                                continue;
                            }
                            Target_Damage(r_target, skill.s_power, s_power);
                        }
                    }
                    else
                    {
                        StatusControl status = target.GetComponent <StatusControl>();
                        int           damage = 0;
                        if (target.layer == LayerMask.NameToLayer("Enemy"))
                        {
                            damage = (int)((_attack + skill.s_power) * s_power * -1);
                            status.Set_HP(damage);
                        }
                        else
                        {
                            Target_Damage(target, skill.s_power, s_power);
                        }
                    }
                    if (GameObject.FindGameObjectWithTag("Range"))
                    {
                        DeleteRange();
                    }
                    StartCoroutine(SkillRecast(skill, skill.s_recast));
                    yield break;
                }
            }
            catch (MissingReferenceException)
            {
                yield break;
            }
            yield return(new WaitForEndOfFrame());
        }
    }
Beispiel #24
0
 // Use this for initialization
 void Start()
 {
     statusControl = playerStatusControl.GetComponent <StatusControl> ();
     LoadMahouData();
     LoadStatusLevel();
 }
Beispiel #25
0
 // Use this for initialization
 void Start()
 {
     statusControl = playerStatusControl.GetComponent <StatusControl> ();
 }