Exemplo n.º 1
0
        public DrawingImage DrawSkeleton(SkeletonEventArgs jointPositions)
        {
            DrawingGroup drawingGroup = new DrawingGroup();
            DrawingImage image        = new DrawingImage(drawingGroup);

            var leftHand  = jointPositions.LeftHandPosition;
            var rightHand = jointPositions.RightHandPosition;

            using (DrawingContext dc = drawingGroup.Open())
            {
                dc.DrawRectangle(Brushes.Transparent, null, new Rect(0.0, 0.0, 640, 480));
                var actionPointsToDraw = ActionPoints.GetActionPoints();

                foreach (var actionPoint in actionPointsToDraw)
                {
                    dc.DrawEllipse(_actionPointBrush, null, new Point(actionPoint.X, actionPoint.Y), actionPoint.Radius,
                                   actionPoint.Radius);
                }

                if (leftHand != null && rightHand != null)
                {
                    dc.DrawEllipse(_rightHandBrush, null, PointToScreen(rightHand), HandCenterThickness, HandCenterThickness);
                    dc.DrawEllipse(_leftHandBrush, null, PointToScreen(leftHand), HandCenterThickness, HandCenterThickness);
                }
            }

            return(image);
        }
Exemplo n.º 2
0
        public ActionResult ACreate(ActionPoints actionPoints)
        {
            TDBContext db = new TDBContext();

            string message = "Saved Successfully";
            bool   status  = true;

            int MID = Convert.ToInt32(TempData["ID"]);


            ActionPoints ac = new ActionPoints
            {
                Catagory    = actionPoints.Catagory,
                Priority    = actionPoints.Priority,
                ActionPoint = actionPoints.ActionPoint,
                DueDate     = actionPoints.DueDate,
                Responsible = actionPoints.Responsible,
                Remarks     = actionPoints.Remarks,
                MissionID   = MID
            };

            db.ActionPoint.Add(ac);
            db.SaveChanges();
            return(Json(new { status = status, message = message, id = db.ActionPoint.Max(x => x.APID) }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
        public ActionResult UpdateAction(ActionPoints model)
        {
            TDBContext db = new TDBContext();

            int MID = Convert.ToInt32(TempData["ID"]);

            ActionPoints ac = new ActionPoints
            {
                APID        = model.APID,
                Catagory    = model.Catagory,
                Priority    = model.Priority,
                ActionPoint = model.ActionPoint,
                DueDate     = model.DueDate,
                Responsible = model.Responsible,
                Remarks     = model.Remarks,
                MissionID   = MID
            };

            db.Entry(ac).State = EntityState.Modified;
            db.SaveChanges();

            string message = "Recored has been updated successfully.";
            bool   status  = true;

            return(Json(new { status = status, message = message }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
    private void UpdateValue(ActionPoints value)
    {
        ClearValue();

        movePoint.color   = value.canMove ? pointOff : pointOn;
        actionPoint.color = value.canAttack ? pointOff : pointOn;
    }
Exemplo n.º 5
0
 void OnTriggerEnter(Collider col)
 {
     if (col.CompareTag("Player"))
     {
         ActionPoints action = col.GetComponent <ActionPoints>();
         action.openevent = Opening;
     }
 }
Exemplo n.º 6
0
        // For cloning.
        public object Clone()
        {
            // We don't clone Cell to avoid recursion.
            BasicUnit unit = new BasicUnit(null, Facing, Class.Tag);

            unit.HealthPoints = (Parameter <int>)HealthPoints.Clone();
            unit.ActionPoints = (Parameter <int>)ActionPoints.Clone();
            return(unit);
        }
Exemplo n.º 7
0
 public void SetUnit(
     PlayerController player,
     Unit unit,
     ActionPoints actionPoints,
     bool enabled
     )
 {
     UpdatePortrait(player, unit);
     UpdateValue(actionPoints);
     UpdateEnabled(enabled);
 }
        public static ActionPoints CreatePointsLister()
        {
            GameObject         whereToPut   = CreatePointsLister("Action Points Lister");
            ActionPoints       points       = whereToPut.AddComponent(typeof(ActionPoints)) as ActionPoints;
            ActionPointsEditor pointsEditor = (ActionPointsEditor)CreateEditor((ActionPoints)points, typeof(ActionPointsEditor));

            pointsEditor.Construct(Color.magenta);
            DestroyImmediate(pointsEditor);
            Selection.activeGameObject = points.gameObject;
            return(points);
        }
Exemplo n.º 9
0
    public void InitializeEnemy()
    {
        animatorHealthbar = GetComponentInChildren <Animator>();
        mapConfig         = GameObject.FindGameObjectWithTag("Map").GetComponent <MapConfig>();
        Vector3 tileCoords = mapConfig.tileMap.WorldCoordToTileCoord((int)transform.position.x, (int)transform.position.z);

        enemyAi      = GetComponent <EnemyAi>();
        actionPoints = GetComponent <ActionPoints>();
        tileX        = (int)tileCoords.x;
        tileY        = (int)tileCoords.z;
        mapConfig.tileMap.UnitMapData(tileX, tileY);
        actionPoints.unitConfig = this;
    }
Exemplo n.º 10
0
        void HighlightFoundedStoryBoard_Completed(object sender, EventArgs e)
        {
            //TODO: animación y puntaje por si completó la colección
            if (hasCompletedCollection)
            {
                this.CompleteCollectionGrid.Visibility = System.Windows.Visibility.Visible;
                this.CloseButton.Visibility            = System.Windows.Visibility.Visible;
                this.CollectionCompleteStoryBoard.Begin();

                CollectionCompleted(this, new CollectionCompleteEventArgs {
                    CollectionId = _item.CollectionId, Points = ActionPoints.Points(ActionPoints.Action.CollectionComplete)
                });
            }
        }
Exemplo n.º 11
0
        public HelpWindow()
        {
            InitializeComponent();

            this.Loaded += HelpWindow_Loaded;

            this.txtPointsLogin.Text             = ActionPoints.Points(ActionPoints.Action.Login).ToString();
            this.txtPointsTutorialCompleted.Text = ActionPoints.Points(ActionPoints.Action.TutorialCompleted).ToString();
            this.txtPointsConfirmationAdded.Text = ActionPoints.Points(ActionPoints.Action.ConfirmationAdded).ToString();
            this.txtPointsLandStatusChanged.Text = ActionPoints.Points(ActionPoints.Action.LandStatusChanged).ToString();
            this.txtPointsShared.Text            = ActionPoints.Points(ActionPoints.Action.Shared).ToString();
            this.txtPointsDemandAuthorities.Text = ActionPoints.Points(ActionPoints.Action.DemandAuthorities).ToString();
            this.txtPointsGames.Text             = ActionPoints.Points(ActionPoints.Action.MiniJuegoI).ToString();
            this.txtVersionNumber.Text           = (Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyFileVersionAttribute), true).FirstOrDefault() as AssemblyFileVersionAttribute).Version;
        }
Exemplo n.º 12
0
        public GameFightMinimalStats GetFightMinimalStats()
        {
            return(new GameFightMinimalStats()
            {
                actionPoints = ActionPoints.TotalInContext(),
                movementPoints = MovementPoints.TotalInContext(),
                maxActionPoints = ActionPoints.Total(),
                maxMovementPoints = MovementPoints.Total(),

                airElementReduction = AirReduction.TotalInContext(),
                airElementResistPercent = AirResistPercent.TotalInContext(),
                baseMaxLifePoints = (uint)MaxLifePoints,
                lifePoints = (uint)CurrentLifePoints,
                maxLifePoints = (uint)CurrentMaxLifePoints,
                invisibilityState = (sbyte)InvisibilityState,
                dodgePALostProbability = (ushort)DodgePAProbability.TotalInContext(),
                dodgePMLostProbability = (ushort)DodgePMProbability.TotalInContext(),
                pvpAirElementReduction = PvPAirReduction.TotalInContext(),
                pvpAirElementResistPercent = PvPAirResistPercent.TotalInContext(),
                pvpEarthElementReduction = PvPEarthReduction.TotalInContext(),
                pvpEarthElementResistPercent = PvPEarthResistPercent.TotalInContext(),
                pvpFireElementReduction = PvPFireReduction.TotalInContext(),
                pvpFireElementResistPercent = PvPFireResistPercent.TotalInContext(),
                pvpNeutralElementReduction = PvPNeutralReduction.TotalInContext(),
                pvpNeutralElementResistPercent = PvPNeutralResistPercent.TotalInContext(),
                pvpWaterElementReduction = PvPWaterReduction.TotalInContext(),
                pvpWaterElementResistPercent = PvPWaterResistPercent.TotalInContext(),
                shieldPoints = (uint)ShieldPoints,
                earthElementReduction = EarthReduction.TotalInContext(),
                earthElementResistPercent = EarthResistPercent.TotalInContext(),
                fireElementResistPercent = FireResistPercent.TotalInContext(),
                waterElementResistPercent = WaterResistPercent.TotalInContext(),
                neutralElementResistPercent = NeutralResistPercent.TotalInContext(),
                fireElementReduction = FireReduction.TotalInContext(),
                neutralElementReduction = NeutralReduction.TotalInContext(),
                waterElementReduction = WaterReduction.TotalInContext(),
                summoned = Summoned,
                summoner = SummonerId,
                tackleBlock = TackleBlock.TotalInContext(),
                tackleEvade = TackleEvade.TotalInContext(),
                pushDamageFixedResist = PushDamageReduction.TotalInContext(),
                permanentDamagePercent = (uint)PermanentDamagePercent.TotalInContext(),
                fixedDamageReflection = Reflect.TotalInContext(),
                criticalDamageFixedResist = CriticalDamageReduction.TotalInContext()
            });
        }
Exemplo n.º 13
0
        public ActionResult GetActions(int ID)
        {
            TDBContext db = new TDBContext();

            ActionPoints data = new ActionPoints();

            var getMission = db.ActionPoint.Where(x => x.APID == ID).FirstOrDefault();

            data.APID        = getMission.APID;
            data.Catagory    = getMission.Catagory;
            data.Priority    = getMission.Priority;
            data.ActionPoint = getMission.ActionPoint;
            data.DueDate     = getMission.DueDate;
            data.Responsible = getMission.Responsible;
            data.Remarks     = getMission.Remarks;

            return(Json(new { success = true, data = data }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 14
0
    //BaseUnitCopy
    void Awake()
    {
        //Load models
        //GameObject classModel = Instantiate(unitClassStats.classModel, modelController.transform);

        //GameObject weaponModel = Instantiate(unitWeapon.weaponModel, classModel.GetComponent<WeaponPosition>().hand);

        //Initiate Variables//
        //////////////////////
        //Get Unit movement points
        movePoints = unitClassStats.maxUnitMovePoints;
        //get unit tile coordinates

        //Add the map incase its missing
        mapConfig    = GameObject.FindGameObjectWithTag("Map").GetComponent <MapConfig>();
        actionPoints = GetComponent <ActionPoints>();
        health       = GetComponent <Health>();
        movement     = GetComponent <UnitMovement>();

        //if (!isFriendly)
        //    InitializeEnemy();

        Vector3 tileCoords = mapConfig.tileMap.WorldCoordToTileCoord((int)transform.position.x, (int)transform.position.z);

        //Set unit position on grid
        tileX = (int)tileCoords.x;
        tileY = (int)tileCoords.z;

        line = GetComponent <LineRenderer>();


        animator          = GetComponentInChildren <AnimationScript>();
        actionPoints      = GetComponent <ActionPoints>();
        health            = GetComponent <Health>();
        animatorHealthbar = GetComponentInChildren <Animator>();
        //movement = GetComponent<UnitMovement>();
    }
Exemplo n.º 15
0
        //Land Requests Handlers
        void landRequests_ConfirmationAdded(object sender, EventArgs e)
        {
            if ((ConfirmationSort)sender == ConfirmationSort.Confirm)
            {
                //Si el usuario antes habia dicho que habia desmonte y cambiode opinion, lo borro del listado de confirmaciones de desmontes
                if (selectedLand.Alerts.Split(',').Any(x => x.Equals(Current.Instance.Earthwatcher.Id.ToString())))
                {
                    //Si no es el primero de la lista
                    if (selectedLand.Alerts.IndexOf("," + Current.Instance.Earthwatcher.Id.ToString()) > -1)
                    {
                        selectedLand.Alerts = selectedLand.Alerts.Replace("," + Current.Instance.Earthwatcher.Id.ToString(), "");
                    }
                    else  //Si es el primero
                    if (selectedLand.Alerts.IndexOf(Current.Instance.Earthwatcher.Id.ToString()) > -1)
                    {
                        selectedLand.Alerts = selectedLand.Alerts.Replace(Current.Instance.Earthwatcher.Id.ToString(), "");
                    }
                }
                //Agrego su verificacion
                if (!string.IsNullOrEmpty(selectedLand.OKs))
                {
                    selectedLand.OKs += ",";
                }
                selectedLand.OKs += Current.Instance.Earthwatcher.Id.ToString();
            }
            else
            {
                //Si el usuario antes habia dicho que NO habia desmonte y cambio de opinion, lo borro del listado de confirmaciones de Sin desmontes
                if (selectedLand.OKs.Split(',').Any(x => x.Equals(Current.Instance.Earthwatcher.Id.ToString())))
                {
                    //Si no es el primero de la lista
                    if (selectedLand.OKs.IndexOf("," + Current.Instance.Earthwatcher.Id.ToString()) > -1)
                    {
                        selectedLand.OKs = selectedLand.OKs.Replace("," + Current.Instance.Earthwatcher.Id.ToString(), "");
                    }
                    else  //Si es el primero
                    if (selectedLand.OKs.IndexOf(Current.Instance.Earthwatcher.Id.ToString()) > -1)
                    {
                        selectedLand.OKs = selectedLand.OKs.Replace(Current.Instance.Earthwatcher.Id.ToString(), "");
                    }
                }
                //Agrego su verificacion
                if (!string.IsNullOrEmpty(selectedLand.Alerts))
                {
                    selectedLand.Alerts += ",";
                }
                selectedLand.Alerts += Current.Instance.Earthwatcher.Id.ToString();
            }

            //Si el usuario antes habia tenido actividad en la parcela lo borro del listado
            if (selectedLand.LastUsersWithActivity != null && selectedLand.LastUsersWithActivity.Split(',').Any(x => x.Equals(Current.Instance.Earthwatcher.FullName)))
            {
                //Si ya estaba en la lista, lo saco
                if (selectedLand.LastUsersWithActivity.IndexOf("," + Current.Instance.Earthwatcher.FullName) > -1)
                {
                    selectedLand.LastUsersWithActivity = selectedLand.LastUsersWithActivity.Replace("," + Current.Instance.Earthwatcher.FullName, "");
                }
                else  //Si ya estaba en la lista y es el primero lo saco
                if (selectedLand.LastUsersWithActivity.IndexOf(Current.Instance.Earthwatcher.FullName) > -1)
                {
                    selectedLand.LastUsersWithActivity = selectedLand.LastUsersWithActivity.Replace(Current.Instance.Earthwatcher.FullName, "");
                }
            }
            //Lo vuelvo a agregar en el orden que corresponda
            if (!string.IsNullOrEmpty(selectedLand.LastUsersWithActivity))
            {
                selectedLand.LastUsersWithActivity += ", ";
            }
            selectedLand.LastUsersWithActivity += Current.Instance.Earthwatcher.FullName;

            bool isUserLand = Current.Instance.Earthwatcher.Lands.Any(x => x.Id == selectedLand.Id);
            bool hasConfirmedThisLandBeforeLastReset = Current.Instance.RegionScores.Any(x => x.Action.Equals(ActionPoints.Action.ConfirmationAdded.ToString()) && x.LandId == selectedLand.Id && x.Published > selectedLand.LastReset);

            if (!isUserLand && !hasConfirmedThisLandBeforeLastReset)
            {
                Current.Instance.AddScore.Add(new Score(Current.Instance.Earthwatcher.Id, ActionPoints.Action.ConfirmationAdded.ToString(), ActionPoints.Points(ActionPoints.Action.ConfirmationAdded), Current.Instance.Earthwatcher.PlayingRegion, Current.Instance.PrecisionScore, selectedLand.Id));
            }

            hexagonLayer.UpdateHexagonsInView();

            UpdateInfo(selectedLand.GeohexKey, true);
            ReportWindowConfirmationEnded(this, EventArgs.Empty);

            if (this.ShareGrid.Visibility == System.Windows.Visibility.Collapsed)
            {
                ShowShareControl();
            }
        }
Exemplo n.º 16
0
        private void DemandButton_Click(object sender, RoutedEventArgs e)
        {
            //Al hacer click redirige a la pagina de denuncias
            string basecamp;
            Uri    demandUri;

            if (Current.Instance.Earthwatcher.PlayingRegion == 1)
            {
                basecamp = "salta01";

                if (selectedLand.BasecampId != null)
                {
                    basecamp = selectedLand.BasecampId.ToString();
                }
                demandUri = new Uri(string.Format("http://greenpeace.org.ar/denuncias/index.php?id_ciberaccion={0}&mail={1}&area={2}&GeohexKey={3}&prev=0&lat={4}&long={5}", 5157, Current.Instance.Earthwatcher.Name, basecamp, selectedLand.GeohexKey, Math.Round(selectedLand.Latitude, 4), Math.Round(selectedLand.Longitude, 4)), UriKind.Absolute);
            }
            else
            {
                if (selectedLand.BasecampId != null)
                {
                    basecamp = selectedLand.BasecampId.ToString();
                }
                basecamp  = "chaco01";
                demandUri = new Uri(string.Format("http://greenpeace.org.ar/denuncias/index.php?id_ciberaccion={0}&mail={1}&area={2}&GeohexKey={3}&prev=0&lat={4}&long={5}", 0, Current.Instance.Earthwatcher.Name, basecamp, selectedLand.GeohexKey, Math.Round(selectedLand.Latitude, 4), Math.Round(selectedLand.Longitude, 4)), UriKind.Absolute);
            }
            this.DemandButton.NavigateUri = demandUri;

            //Agrega el score de demanda
            if (!Current.Instance.RegionScores.Any(x => x.Action.Equals(ActionPoints.Action.DemandAuthorities.ToString()) && x.LandId == selectedLand.Id))
            {
                Current.Instance.AddScore.Add(new Score(Current.Instance.Earthwatcher.Id, ActionPoints.Action.DemandAuthorities.ToString(), ActionPoints.Points(ActionPoints.Action.DemandAuthorities), Current.Instance.Earthwatcher.PlayingRegion, Current.Instance.PrecisionScore, selectedLand.Id));
                ReportWindowDemand(this, EventArgs.Empty);
                hexagonLayer.UpdateHexagonsInView();
            }
            //Agrega el score de Share
            else if (!Current.Instance.RegionScores.Any(x => x.Action.Equals(ActionPoints.Action.Shared.ToString()) && x.LandId == selectedLand.Id))
            {
                Current.Instance.AddScore.Add(new Score(Current.Instance.Earthwatcher.Id, ActionPoints.Action.Shared.ToString(), ActionPoints.Points(ActionPoints.Action.Shared), Current.Instance.Earthwatcher.PlayingRegion, Current.Instance.PrecisionScore, selectedLand.Id));
                ReportWindowDemand(this, EventArgs.Empty);
            }
        }
Exemplo n.º 17
0
 private void AddTwFbSharePoints()
 {
     if (!Current.Instance.RegionScores.Any(x => x.Action.Equals(ActionPoints.Action.Shared.ToString()) && x.LandId == selectedLand.Id && x.Published > DateTime.UtcNow.AddDays(-7)))
     {
         Current.Instance.AddScore.Add(new Score(Current.Instance.Earthwatcher.Id, ActionPoints.Action.Shared.ToString(), ActionPoints.Points(ActionPoints.Action.Shared), Current.Instance.Earthwatcher.PlayingRegion, Current.Instance.PrecisionScore, selectedLand.Id));
         ReportWindowDemand(this, EventArgs.Empty);
     }
 }
Exemplo n.º 18
0
        //public void Move()
        //{
        //    if (selectedLand == null)
        //        return;

        //    var spherical = SphericalMercator.FromLonLat(selectedLand.Longitude, selectedLand.Latitude);
        //    var point = Current.Instance.MapControl.Viewport.WorldToScreen(spherical.x, spherical.y);
        //    Margin = new Thickness(point.X + 70, point.Y - 30, 0, 0);
        //}
        private void SetLandStatusStatusChanged(object sender, EventArgs e)
        {
            if (status == LandStatus.Alert || status == LandStatus.Ok)
            {
                bool hasCheckedThisLandBeforeLastReset = Current.Instance.RegionScores.Any(x => x.Action.Equals(ActionPoints.Action.LandStatusChanged.ToString()) && x.LandId == selectedLand.Id && x.Published > selectedLand.LastReset);

                if (!hasCheckedThisLandBeforeLastReset)
                {
                    Current.Instance.AddScore.Add(new Score(Current.Instance.Earthwatcher.Id, ActionPoints.Action.LandStatusChanged.ToString(), ActionPoints.Points(ActionPoints.Action.LandStatusChanged), Current.Instance.Earthwatcher.PlayingRegion, Current.Instance.PrecisionScore, selectedLand.Id));
                }
            }

            ReportWindowLandStatusChanged(this, EventArgs.Empty);
            if (this.ShareGrid.Visibility == System.Windows.Visibility.Collapsed)
            {
                ShowShareControl();
            }
        }
Exemplo n.º 19
0
        //Button's Click
        private void ButtonStart_Click(object sender, RoutedEventArgs e)
        {
            currentStep++;
            this.StartStoryBoard.Begin();

            Current.Instance.AddScore.Add(new Score(Current.Instance.Earthwatcher.Id, ActionPoints.Action.PreTutorialStep1.ToString(), ActionPoints.Points(ActionPoints.Action.PreTutorialStep1), Current.Instance.Earthwatcher.PlayingRegion, Current.Instance.PrecisionScore));
            PointsAdded(this, EventArgs.Empty);
        }
Exemplo n.º 20
0
        public CharacterCharacteristicsInformations GetCharacterCharacteristics(Character character)
        {
            ulong expFloor     = ExperienceRecord.GetExperienceForLevel(character.Level).Player;
            ulong expNextFloor = ExperienceRecord.GetExperienceForNextLevel(character.Level).Player;

            CharacterCharacteristicsInformations informations = new CharacterCharacteristicsInformations()
            {
                actionPoints            = ActionPoints.GetBaseCharacteristic(),
                actionPointsCurrent     = ActionPoints.TotalInContext(),
                additionnalPoints       = 0,
                agility                 = Agility.GetBaseCharacteristic(),
                airDamageBonus          = AirDamageBonus.GetBaseCharacteristic(),
                airElementReduction     = AirReduction.GetBaseCharacteristic(),
                airElementResistPercent = AirResistPercent.GetBaseCharacteristic(),
                alignmentInfos          = character.Record.Alignment.GetActorExtendedAlignement(),
                allDamagesBonus         = AllDamagesBonus.GetBaseCharacteristic(),
                chance = Chance.GetBaseCharacteristic(),
                criticalDamageBonus          = CriticalDamageBonus.GetBaseCharacteristic(),
                criticalDamageReduction      = CriticalDamageReduction.GetBaseCharacteristic(),
                criticalHit                  = CriticalHit.GetBaseCharacteristic(),
                criticalHitWeapon            = CriticalHitWeapon,
                criticalMiss                 = Characteristic.Zero().GetBaseCharacteristic(),
                damagesBonusPercent          = DamagesBonusPercent.GetBaseCharacteristic(),
                dodgePALostProbability       = DodgePAProbability.GetBaseCharacteristic(),
                dodgePMLostProbability       = DodgePMProbability.GetBaseCharacteristic(),
                earthDamageBonus             = EarthDamageBonus.GetBaseCharacteristic(),
                earthElementReduction        = EarthReduction.GetBaseCharacteristic(),
                earthElementResistPercent    = EarthResistPercent.GetBaseCharacteristic(),
                pvpEarthElementReduction     = PvPEarthReduction.GetBaseCharacteristic(),
                pvpEarthElementResistPercent = PvPEarthResistPercent.GetBaseCharacteristic(),
                fireDamageBonus              = FireDamageBonus.GetBaseCharacteristic(),
                fireElementReduction         = FireReduction.GetBaseCharacteristic(),
                fireElementResistPercent     = FireResistPercent.GetBaseCharacteristic(),
                pvpFireElementReduction      = PvPFireReduction.GetBaseCharacteristic(),
                pvpFireElementResistPercent  = PvPFireResistPercent.GetBaseCharacteristic(),
                glyphBonusPercent            = GlyphBonusPercent.GetBaseCharacteristic(),
                healBonus                      = HealBonus.GetBaseCharacteristic(),
                initiative                     = new CharacterBaseCharacteristic((short)FormulasProvider.Instance.BaseInitiative(this), 0, Initiative.Total(), 0, 0),
                intelligence                   = Intelligence.GetBaseCharacteristic(),
                kamas                          = character.Record.Kamas,
                lifePoints                     = (uint)LifePoints,
                maxEnergyPoints                = MaxEnergyPoints,
                maxLifePoints                  = (uint)MaxLifePoints,
                movementPoints                 = MovementPoints.GetBaseCharacteristic(),
                movementPointsCurrent          = MovementPoints.TotalInContext(),
                PMAttack                       = PMAttack.GetBaseCharacteristic(),
                PAAttack                       = PAAttack.GetBaseCharacteristic(),
                pvpAirElementReduction         = PvPAirReduction.GetBaseCharacteristic(),
                pvpAirElementResistPercent     = PvPAirResistPercent.GetBaseCharacteristic(),
                pvpNeutralElementReduction     = PvPNeutralReduction.GetBaseCharacteristic(),
                pvpNeutralElementResistPercent = PvPNeutralResistPercent.GetBaseCharacteristic(),
                pvpWaterElementReduction       = PvPWaterReduction.GetBaseCharacteristic(),
                pvpWaterElementResistPercent   = PvPWaterResistPercent.GetBaseCharacteristic(),
                energyPoints                   = Energy,
                experience                     = character.Experience,
                experienceLevelFloor           = expFloor,
                experienceNextLevelFloor       = expNextFloor,
                neutralDamageBonus             = NeutralDamageBonus.GetBaseCharacteristic(),
                neutralElementReduction        = NeutralReduction.GetBaseCharacteristic(),
                neutralElementResistPercent    = NeutralResistPercent.GetBaseCharacteristic(),
                tackleEvade                    = TackleEvade.GetBaseCharacteristic(),
                tackleBlock                    = TackleBlock.GetBaseCharacteristic(),
                range                          = Range.GetBaseCharacteristic(),
                waterElementReduction          = WaterReduction.GetBaseCharacteristic(),
                waterDamageBonus               = WaterDamageBonus.GetBaseCharacteristic(),
                waterElementResistPercent      = WaterResistPercent.GetBaseCharacteristic(),
                reflect                        = Reflect.GetBaseCharacteristic(),
                permanentDamagePercent         = PermanentDamagePercent.GetBaseCharacteristic(),
                prospecting                    = Prospecting.GetBaseCharacteristic(),
                pushDamageBonus                = PushDamageBonus.GetBaseCharacteristic(),
                pushDamageReduction            = PushDamageReduction.GetBaseCharacteristic(),
                runeBonusPercent               = RuneBonusPercent.GetBaseCharacteristic(),
                spellModifications             = new CharacterSpellModification[0],
                spellsPoints                   = character.Record.SpellPoints,
                statsPoints                    = character.Record.StatsPoints,
                vitality                       = Vitality.GetBaseCharacteristic(),
                strength                       = Strength.GetBaseCharacteristic(),
                summonableCreaturesBoost       = SummonableCreaturesBoost.GetBaseCharacteristic(),
                trapBonus                      = TrapBonus.GetBaseCharacteristic(),
                trapBonusPercent               = TrapBonusPercent.GetBaseCharacteristic(),
                weaponDamagesBonusPercent      = WeaponDamagesBonusPercent.GetBaseCharacteristic(),
                wisdom                         = Wisdom.GetBaseCharacteristic(),
                probationTime                  = 0,
            };

            return(informations);
        }
Exemplo n.º 21
0
        void earthwatcherRequest_LandReassignedByPlayingRegion(object sender, EventArgs e)
        {
            Land land = sender as Land;

            try
            {
                if (land != null)
                {
                    //Cambios en memoria de lands
                    var oldLand = Current.Instance.Lands.Where(x => x.Id == Current.Instance.Earthwatcher.Lands.FirstOrDefault().Id).FirstOrDefault();
                    if (oldLand != null)
                    {
                        //Si no está en amarillo o en verde la saco
                        if (oldLand.LandStatus != LandStatus.Alert && oldLand.LandStatus != LandStatus.Ok)
                        {
                            Current.Instance.Lands.Remove(oldLand);
                            Current.Instance.LandInView.Remove(oldLand);
                        }
                        else
                        {   //Si es amarilla o verde la paso a greenpeace
                            oldLand.EarthwatcherId   = Configuration.GreenpeaceId;
                            oldLand.EarthwatcherName = Configuration.GreenpeaceName;
                            oldLand.IsPowerUser      = true;
                        }
                        //Saco del current instance del Ew la land que quiero cambiar
                        var oldEarthwatcherLand = Current.Instance.Earthwatcher.Lands.Where(x => x.Id == oldLand.Id).FirstOrDefault();
                        Current.Instance.Earthwatcher.Lands.Remove(oldEarthwatcherLand);
                    }
                    //si la land que me asignaron no esta en el current instance de lands, la agrega y se la agrega al Ew
                    if (!Current.Instance.Lands.Any(x => x.Id == land.Id))
                    {
                        Current.Instance.Lands.Add(land);
                        Current.Instance.Earthwatcher.Lands.Add(land);
                    }

                    //Actualizo en memoria la nueva region
                    Current.Instance.Region = _selectedRegion;

                    var hexagonLayer = Current.Instance.LayerHelper.FindLayer(Constants.Hexagonlayername) as Earthwatchers.UI.Layers.HexagonLayer;

                    if (hexagonLayer != null)
                    {
                        hexagonLayer.AddHexagon(land);
                    }

                    if (land.IsTutorLand) //Is Tutor Land - All region is complete
                    {
                        //Muestro el mensaje, Deshabilito mi parcela
                        NotificationsWindow notificationsWindow = new NotificationsWindow(ActionPoints.Action.RegionCompleted.ToString());
                        notificationsWindow.Show();
                    }
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                //Traigo nuevamente las lands para el pais que estoy jugando
                landRequests.GetAll(Current.Instance.Earthwatcher.Id, Current.Instance.Earthwatcher.PlayingRegion);

                Earthwatcher earthwatcher = Current.Instance.Earthwatcher;

                if (land == null)
                {
                    MessageBox.Show(Labels.NoMoreLands);
                    ChangeCompleted(this, EventArgs.Empty);
                }
                else
                {
                    //Logueo el cambio de pais de juego
                    MapHelper.ZoomToHexagon(Current.Instance.MapControl, land.GeohexKey);
                    Current.Instance.AddScore.Add(new Score(earthwatcher.Id, ActionPoints.Action.PlayingRegionChanged.ToString(), ActionPoints.Points(ActionPoints.Action.PlayingRegionChanged), earthwatcher.PlayingRegion, Current.Instance.PrecisionScore, earthwatcher.Lands.FirstOrDefault().Id));
                    // Recibe el evento en mainpage y le asigna el puntaje
                    ChangeCompleted(this, EventArgs.Empty);
                }
            }
        }
Exemplo n.º 22
0
 private void NextButton_Click(object sender, EventArgs e)
 {
     step++;
     if (step > 2)
     {
         Current.Instance.AddScore.Add(new Score(Current.Instance.Earthwatcher.Id, ActionPoints.Action.ContextTutorialCompleted.ToString(), ActionPoints.Points(ActionPoints.Action.ContextTutorialCompleted), Current.Instance.Earthwatcher.PlayingRegion, Current.Instance.PrecisionScore));
         PointsAdded(this, EventArgs.Empty);
         this.Close();
     }
     else
     {
         TutorialText1.Visibility    = Visibility.Collapsed;
         TutorialText2.Visibility    = Visibility.Visible;
         DeforestationImg.Visibility = Visibility.Visible;
     }
 }
Exemplo n.º 23
0
        public void logSlInstall()
        {
            var connectionstring  = System.Configuration.ConfigurationManager.ConnectionStrings["EarthwatchersConnection"].ConnectionString;
            IScoreRepository repo = new ScoreRepository(connectionstring);
            Score            s    = new Score(17, ActionPoints.Action.Log.ToString(), ActionPoints.Points(ActionPoints.Action.Log), 0, 100, null, null, "SL_Install");

            repo.PostScore(s);
        }
Exemplo n.º 24
0
        private void Next1_Click(object sender, RoutedEventArgs e)
        {
            this.Next1.IsHitTestVisible = false;

            currentStep++;
            if (currentStep == 2)
            {
                this.Welcome2.Visibility = System.Windows.Visibility.Visible;
                this.Welcome2StoryBoard.Begin();

                Current.Instance.AddScore.Add(new Score(Current.Instance.Earthwatcher.Id, ActionPoints.Action.PreTutorialStep2.ToString(), ActionPoints.Points(ActionPoints.Action.PreTutorialStep2), Current.Instance.Earthwatcher.PlayingRegion, Current.Instance.PrecisionScore));
                PointsAdded(this, EventArgs.Empty);
            }
            else if (currentStep == 3)
            {
                this.Welcome1.Visibility = System.Windows.Visibility.Collapsed;
                this.Welcome3.Visibility = System.Windows.Visibility.Visible;
                this.Welcome3StoryBoard.Begin();

                Current.Instance.AddScore.Add(new Score(Current.Instance.Earthwatcher.Id, ActionPoints.Action.PreTutorialStep3.ToString(), ActionPoints.Points(ActionPoints.Action.PreTutorialStep3), Current.Instance.Earthwatcher.PlayingRegion, Current.Instance.PrecisionScore));
                PointsAdded(this, EventArgs.Empty);
            }
            else if (currentStep == 4)
            {
                this.Welcome2.Visibility = System.Windows.Visibility.Collapsed;
                this.Welcome4.Visibility = System.Windows.Visibility.Visible;
                this.Welcome4StoryBoard.Begin();

                Current.Instance.AddScore.Add(new Score(Current.Instance.Earthwatcher.Id, ActionPoints.Action.PreTutorialStep4.ToString(), ActionPoints.Points(ActionPoints.Action.PreTutorialStep4), Current.Instance.Earthwatcher.PlayingRegion, Current.Instance.PrecisionScore));
                PointsAdded(this, EventArgs.Empty);
            }
            else
            {
                this.Close();
            }
        }
Exemplo n.º 25
0
 public PositionChecker(IKinectService kinectService)
 {
     _kinectService = kinectService;
     _kinectService.SkeletonUpdated += _kinectService_SkeletonUpdated;
     _actionPointsToCheck            = ActionPoints.GetActionPoints();
 }
Exemplo n.º 26
0
Arquivo: NPC.cs Projeto: cvogt/AlbLib
        public override int GetHashCode()
        {
            int hashCode = 0;

            unchecked {
                if (unknown != null)
                {
                    hashCode += 1000000007 * unknown.GetHashCode();
                }
                hashCode += 1000000009 * Type.GetHashCode();
                hashCode += 1000000021 * Gender.GetHashCode();
                hashCode += 1000000033 * Race.GetHashCode();
                hashCode += 1000000087 * Class.GetHashCode();
                hashCode += 1000000093 * Magic.GetHashCode();
                hashCode += 1000000097 * Level.GetHashCode();
                hashCode += 1000000103 * Language.GetHashCode();
                hashCode += 1000000123 * Appearance.GetHashCode();
                hashCode += 1000000181 * Face.GetHashCode();
                hashCode += 1000000207 * InventoryPicture.GetHashCode();
                hashCode += 1000000223 * ActionPoints.GetHashCode();
                hashCode += 1000000241 * DialogueOptions.GetHashCode();
                hashCode += 1000000271 * ResponseOptions.GetHashCode();
                hashCode += 1000000289 * TrainingPoints.GetHashCode();
                hashCode += 1000000297 * Gold.GetHashCode();
                hashCode += 1000000321 * Rations.GetHashCode();
                hashCode += 1000000349 * Conditions.GetHashCode();
                hashCode += 1000000363 * Strength.GetHashCode();
                hashCode += 1000000403 * Intelligence.GetHashCode();
                hashCode += 1000000409 * Dexterity.GetHashCode();
                hashCode += 1000000411 * Speed.GetHashCode();
                hashCode += 1000000427 * Stamina.GetHashCode();
                hashCode += 1000000433 * Luck.GetHashCode();
                hashCode += 1000000439 * MagicResistance.GetHashCode();
                hashCode += 1000000447 * MagicTallent.GetHashCode();
                hashCode += 1000000453 * CloseRangeCombat.GetHashCode();
                hashCode += 1000000459 * LongRangeCombat.GetHashCode();
                hashCode += 1000000483 * CriticalHit.GetHashCode();
                hashCode += 1000000513 * Lockpicking.GetHashCode();
                hashCode += 1000000531 * LifePoints.GetHashCode();
                hashCode += 1000000579 * SpellPoints.GetHashCode();
                hashCode += 1000000007 * Age.GetHashCode();
                hashCode += 1000000009 * BaseProtection.GetHashCode();
                hashCode += 1000000021 * Protection.GetHashCode();
                hashCode += 1000000033 * BaseDamage.GetHashCode();
                hashCode += 1000000087 * Damage.GetHashCode();
                hashCode += 1000000093 * Experience.GetHashCode();
                if (Spells != null)
                {
                    hashCode += 1000000097 * Spells.GetHashCode();
                }
                if (Name != null)
                {
                    hashCode += 1000000103 * Name.GetHashCode();
                }
                if (SpellStrengths != null)
                {
                    hashCode += 1000000123 * SpellStrengths.GetHashCode();
                }
            }
            return(hashCode);
        }
Exemplo n.º 27
0
 public override void Serialize(IDataWriter writer)
 {
     writer.WriteVarUhLong(Experience);
     writer.WriteVarUhLong(ExperienceLevelFloor);
     writer.WriteVarUhLong(ExperienceNextLevelFloor);
     writer.WriteVarUhLong(ExperienceBonusLimit);
     writer.WriteVarUhLong(Kamas);
     writer.WriteVarUhShort(StatsPoints);
     writer.WriteVarUhShort(AdditionnalPoints);
     writer.WriteVarUhShort(SpellsPoints);
     AlignmentInfos.Serialize(writer);
     writer.WriteVarUhInt(LifePoints);
     writer.WriteVarUhInt(MaxLifePoints);
     writer.WriteVarUhShort(EnergyPoints);
     writer.WriteVarUhShort(MaxEnergyPoints);
     writer.WriteVarShort(ActionPointsCurrent);
     writer.WriteVarShort(MovementPointsCurrent);
     Initiative.Serialize(writer);
     Prospecting.Serialize(writer);
     ActionPoints.Serialize(writer);
     MovementPoints.Serialize(writer);
     Strength.Serialize(writer);
     Vitality.Serialize(writer);
     Wisdom.Serialize(writer);
     Chance.Serialize(writer);
     Agility.Serialize(writer);
     Intelligence.Serialize(writer);
     Range.Serialize(writer);
     SummonableCreaturesBoost.Serialize(writer);
     Reflect.Serialize(writer);
     CriticalHit.Serialize(writer);
     writer.WriteVarUhShort(CriticalHitWeapon);
     CriticalMiss.Serialize(writer);
     HealBonus.Serialize(writer);
     AllDamagesBonus.Serialize(writer);
     WeaponDamagesBonusPercent.Serialize(writer);
     DamagesBonusPercent.Serialize(writer);
     TrapBonus.Serialize(writer);
     TrapBonusPercent.Serialize(writer);
     GlyphBonusPercent.Serialize(writer);
     RuneBonusPercent.Serialize(writer);
     PermanentDamagePercent.Serialize(writer);
     TackleBlock.Serialize(writer);
     TackleEvade.Serialize(writer);
     PAAttack.Serialize(writer);
     PMAttack.Serialize(writer);
     PushDamageBonus.Serialize(writer);
     CriticalDamageBonus.Serialize(writer);
     NeutralDamageBonus.Serialize(writer);
     EarthDamageBonus.Serialize(writer);
     WaterDamageBonus.Serialize(writer);
     AirDamageBonus.Serialize(writer);
     FireDamageBonus.Serialize(writer);
     DodgePALostProbability.Serialize(writer);
     DodgePMLostProbability.Serialize(writer);
     NeutralElementResistPercent.Serialize(writer);
     EarthElementResistPercent.Serialize(writer);
     WaterElementResistPercent.Serialize(writer);
     AirElementResistPercent.Serialize(writer);
     FireElementResistPercent.Serialize(writer);
     NeutralElementReduction.Serialize(writer);
     EarthElementReduction.Serialize(writer);
     WaterElementReduction.Serialize(writer);
     AirElementReduction.Serialize(writer);
     FireElementReduction.Serialize(writer);
     PushDamageReduction.Serialize(writer);
     CriticalDamageReduction.Serialize(writer);
     PvpNeutralElementResistPercent.Serialize(writer);
     PvpEarthElementResistPercent.Serialize(writer);
     PvpWaterElementResistPercent.Serialize(writer);
     PvpAirElementResistPercent.Serialize(writer);
     PvpFireElementResistPercent.Serialize(writer);
     PvpNeutralElementReduction.Serialize(writer);
     PvpEarthElementReduction.Serialize(writer);
     PvpWaterElementReduction.Serialize(writer);
     PvpAirElementReduction.Serialize(writer);
     PvpFireElementReduction.Serialize(writer);
     MeleeDamageDonePercent.Serialize(writer);
     MeleeDamageReceivedPercent.Serialize(writer);
     RangedDamageDonePercent.Serialize(writer);
     RangedDamageReceivedPercent.Serialize(writer);
     WeaponDamageDonePercent.Serialize(writer);
     WeaponDamageReceivedPercent.Serialize(writer);
     SpellDamageDonePercent.Serialize(writer);
     SpellDamageReceivedPercent.Serialize(writer);
     writer.WriteShort((short)SpellModifications.Count);
     foreach (var x in SpellModifications)
     {
         x.Serialize(writer);
     }
     writer.WriteInt(ProbationTime);
 }
 // Use this for initialization
 void Start()
 {
     actionPoints = GetComponent <ActionPoints>();
     currentAP    = actionPoints.CurrentAP;
 }
Exemplo n.º 29
0
 private void CacheComponents()
 {
     mana         = GetComponent <Mana>();
     playerHealth = GetComponent <Health>();
     actionPoints = GetComponent <ActionPoints>();
 }
Exemplo n.º 30
0
 // Called when turn for player controlling this unit starts.
 public void TurnStart()
 {
     ActionPoints.Reset();
 }