Ejemplo n.º 1
0
    public void ShootAmmo(float aimAngle)
    {
        GameObject spawnedAmmo = Instantiate(ammo);

        spawnedAmmo.transform.position = CustomFunctions.GetAmmoSpawnPos(playerController.gameObject);

        spawnedAmmo.transform.rotation = Quaternion.Euler(0, 0, aimAngle * Mathf.Rad2Deg);

        AmmoVelocity ammoVelocity = spawnedAmmo.GetComponent <AmmoVelocity>();

        ammoVelocity.direction = Vector2.right;
        ammoVelocity.speed     = GameManager.instance.GetPlayerWeapon(playerController.gameObject).ammoVelocity;

        DamageZone ammoDamage = spawnedAmmo.GetComponent <DamageZone>();

        ammoDamage.ignorePlayer             = playerController.gameObject;
        ammoDamage.playerThatShotThis       = playerController.gameObject;
        ammoDamage.damage                   = GameManager.instance.GetPlayerWeapon(playerController.gameObject).damage;
        ammoDamage.destroyOnWallCollision   = destroyAmmoOnWallCollision;
        ammoDamage.destroyOnPlayerCollision = true;
        CustomFunctions.SetTrailColor(spawnedAmmo.GetComponent <TrailRenderer>(), GameManager.instance.GetPlayerId(playerController.gameObject));
        Physics2D.IgnoreCollision(spawnedAmmo.GetComponent <Collider2D>(), playerController.GetComponent <Collider2D>());

        Destroy(spawnedAmmo, 10f);
    }
Ejemplo n.º 2
0
    IEnumerator Parry()
    {
        if (CanParry())
        {
            if (currentParryState == ParryState.None)
            {
                playerAnim.Play("Parry");
                CustomFunctions.PlaySound(parryBubbleSound);
                currentParryState = ParryState.IsParrying;
                parryCircle.transform.localScale = new Vector3(0.75f, 0.75f, 0.75f);
                while (parryCircle.transform.localScale.x > 0)
                {
                    parryCircle.transform.localScale -= new Vector3(0.01f, 0.01f, 0.01f) * Mathf.Exp(1.5f - parryCircle.transform.localScale.x);
                    yield return(new WaitForSeconds(0.01f));
                }
            }

            if (parryCircle.transform.localScale.x <= 0)
            {
                //print("DONE");
                currentParryState = ParryState.ParryCooldown;
                if (parryWasSuccessful == false)
                {
                    yield return(new WaitForSeconds(0.2f));
                }

                StopParry();
            }
        }

        yield break;
    }
    void LookAtMouse()
    {
        Vector2 mouseScreen = Input.mousePosition;
        Vector2 mouse       = Camera.main.ScreenToWorldPoint(mouseScreen);

        CustomFunctions.LookAt2D(transform, transform.position, mouse);
    }
Ejemplo n.º 4
0
        /// <summary>
        /// Defines the <see cref="CustomFunctions"/> for the DynamoExpression interpreter.
        /// </summary>
        public static void PrepareCustomFunctions()
        {
            //date("2012-12-25")
            var dateFormats = new[] { "yyyy-MM-dd" };
            Func <string, DateTime> date = (s) => XmlConvert.ToDateTime(s, dateFormats);

            CustomFunctions.Add("date", date);

            //date and time("2012-12- 24T23:59:00")
            var dateAndTimeFormats = new[] { "yyyy-MM-ddTHH:mm:sszzzzzz", "yyyy-MM-ddTHH:mm:ss", "yyyy-MM-ddTHH:mm" };
            Func <string, DateTime> dateAndTime = (s) => XmlConvert.ToDateTime(s, dateAndTimeFormats);

            CustomFunctions.Add("date_and_time", dateAndTime);
            CustomFunctionTranslations.Add("date and time", "date_and_time");

            //time("23:59:00")
            var timeFormats = new[] { "HH:mm:sszzzzzz", "HH:mm:ss", "HH:mm" };
            Func <string, DateTime> time = (s) => XmlConvert.ToDateTime(s, timeFormats);

            CustomFunctions.Add("time", time);

            //duration("P3Y")
            Func <string, TimeSpan> duration = XmlConvert.ToTimeSpan;

            CustomFunctions.Add("duration", duration);
        }
Ejemplo n.º 5
0
    void SetPlayerColor(GameObject player)
    {
        int playerId = GetPlayerId(player);

        player.GetComponent <SpriteRenderer>().material.SetColor("NewColor1", CustomFunctions.PlayerIdToColor(playerId));
        //player.GetComponent<SpriteRenderer>().material.SetColor("NewColor1", Color.white);
        player.GetComponent <SpriteRenderer>().material.SetColor("NewColor2", CustomFunctions.DarkColor(CustomFunctions.PlayerIdToColor(playerId)));
    }
Ejemplo n.º 6
0
 public static void ProcessCustomFunctions(CustomFunctions cfs, XmlWriter xmlw)
 {
     xmlw.WriteStartElement("CustomFunctions");
     xmlw.WriteAttributeString("Count", cfs.Count.ToStringSafe());
     foreach (CustomFunction cf in cfs)
     {
         ProcessCustomFunction(cf, xmlw);
     }
     xmlw.WriteEndElement();
 }
Ejemplo n.º 7
0
 public void DestroyThis()
 {
     if (hitParticlePrefab != null)
     {
         GameObject hitParticle = Instantiate(hitParticlePrefab);
         hitParticle.transform.position = this.transform.position;
         CustomFunctions.PlaySound(CustomFunctions.instance.ammoHit);
         Destroy(hitParticle, 1f);
     }
     Destroy(this.gameObject);
 }
 public XrmButtonViewModel GetButton(string id)
 {
     if (CustomFunctions.Any(b => b.Id == id))
     {
         return(CustomFunctions.First(b => b.Id == id));
     }
     if (CustomFunctions.Where(b => b.HasChildOptions).SelectMany(b => b.ChildButtons).Any(b => b.Id == id))
     {
         return(CustomFunctions.Where(b => b.HasChildOptions).SelectMany(b => b.ChildButtons).First(b => b.Id == id));
     }
     throw new ArgumentOutOfRangeException("id", "No Button Found With Id Of " + id);
 }
Ejemplo n.º 9
0
    /// <summary>
    /// Seeds the random number generator with an automatically-determined value, then builds the game map.
    /// </summary>
    /// <param name="mapOfTheDay">If true, the RNG will be seeded with today's date. If false,
    /// the RNG will be seed with the current date and time to the millisecond.</param>
    public void GenerateMap(bool mapOfTheDay)
    {
        if (mapOfTheDay)
        {
            CustomFunctions.InitRandomToToday();
        }
        else
        {
            CustomFunctions.InitRandomToNow();
        }

        MapBuilder();
    }
Ejemplo n.º 10
0
    void BounceAmmo(Collision2D collision)
    {
        if (currentNumberOfBounces < numberOfBouncesBeforeDestroying)
        {
            currentNumberOfBounces++;

            CustomFunctions.PlaySound(bounceSound);
            transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, transform.rotation.eulerAngles.z - 180f);
        }
        else
        {
            ammoDamageZone.DestroyThis();
        }
    }
Ejemplo n.º 11
0
 public static void ProcessCustomFunctions(CustomFunctions cfs, Utf8JsonWriter jsonw)
 {
     jsonw.WritePropertyName("CustomFunctions");
     jsonw.WriteStartObject();
     jsonw.WriteString("Count", cfs.Count.ToStringSafe());
     jsonw.WritePropertyName("Items");
     jsonw.WriteStartArray();
     foreach (CustomFunction cf in cfs)
     {
         ProcessCustomFunction(cf, jsonw);
     }
     jsonw.WriteEndArray();
     jsonw.WriteEndObject();
 }
Ejemplo n.º 12
0
    void ApplyJumpForce()
    {
        CustomFunctions.PlaySound(CustomFunctions.instance.jumpSound);
        playerRigidbody.velocity = new Vector2(0f, 0f);

        playerRigidbody.AddForce(Vector2.up * jumpForce, ForceMode2D.Impulse);
        if (GetComponent <PlayerHealth>().currentHealth > 0)
        {
            anim.Play("Jump");
        }

        /*GameObject spawnedJumpParticles = Instantiate(jumpParticlesPrefab, this.transform);
         * spawnedJumpParticles.transform.position = this.transform.position;
         * Destroy(spawnedJumpParticles, 1f);*/
    }
Ejemplo n.º 13
0
    void SetCrosshairPosition(bool isUsingMouse)
    {
        if (isUsingAutoAim == false)
        {
            if (isUsingMouse)
            {
                var worldMousePosition = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 0f));
                var facingDirection    = worldMousePosition - transform.position;
                aimAngle = Mathf.Atan2(facingDirection.y, facingDirection.x);
                if (aimAngle < 0f)
                {
                    aimAngle = Mathf.PI * 2 + aimAngle;
                }
            }
            else
            {
                aimAngle = Mathf.Acos(rightStickPosition.x);
                if (rightStickPosition.y < 0)
                {
                    aimAngle = -aimAngle;
                }
            }
        }
        else
        {
            Vector3 targetPos = CustomFunctions.GetClosestPlayerPosition(this.transform.position);

            if (Spawner.instance.isInZombieMode)
            {
                targetPos = CustomFunctions.GetClosestZombiePosition(this.transform.position);
            }

            aimAngle = GetAutoAimAngle(targetPos);
        }

        //print("Aim Angle : " + aimAngle);
        if (!crosshairSprite.enabled)
        {
            crosshairSprite.enabled = true;
        }

        var x = transform.position.x + 1f * Mathf.Cos(aimAngle);
        var y = transform.position.y + 1f * Mathf.Sin(aimAngle);

        var crossHairPosition = new Vector3(x, y, 0);

        crosshair.transform.position = crossHairPosition;
    }
Ejemplo n.º 14
0
    void SetSettings()
    {
        this.transform.rotation               = settings.bulletRotation;
        velocityScript.speed                  = settings.ammoSpeed;
        velocityScript.direction              = settings.ammoDirection;
        damageScript.destroyOnWallCollision   = settings.destroyOnWallCollision;
        damageScript.destroyOnPlayerCollision = settings.destroyOnPlayerCollision;
        damageScript.ignorePlayer             = settings.ignorePlayer;
        damageScript.playerThatShotThis       = settings.playerWhoSpawnedThis;
        Physics2D.IgnoreCollision(this.GetComponent <Collider2D>(), settings.ignorePlayer.GetComponent <Collider2D>());

        if (GetComponent <TrailRenderer>() != null)
        {
            CustomFunctions.SetTrailColor(GetComponent <TrailRenderer>(), GameManager.instance.GetPlayerId(settings.playerWhoSpawnedThis));
        }
    }
Ejemplo n.º 15
0
    void IHealthEntity.DoDamage(float damageAmount, GameObject playerThatShot)
    {
        if (currentHealth <= 0) //if we're playing the death anim, we dont take damage
        {
            return;
        }

        currentHealth -= damageAmount;
        CustomFunctions.HitPause();
        CustomFunctions.PlaySound(getHitSound);

        if (currentHealth <= 0)
        {
            Die(playerThatShot);
        }
    }
Ejemplo n.º 16
0
        public void Rule_FilterOverProject_does_promote_to_single_Select_if_custom_function_and_doesnt_opt_in()
        {
            var expectedSql =
                @"SELECT 
        [Extent1].[Id] AS [Id], 
        [SqlServer].[MyCustomFunc]([Extent1].[Name]) AS [C1]
        FROM [dbo].[Blogs] AS [Extent1]
    WHERE ([SqlServer].[MyCustomFunc]([Extent1].[Name])) > 10";

            using (var context = new BlogContext())
            {
                context.Configuration.UseDatabaseNullSemantics = true;
                context.Configuration.DisableFilterOverProjectionSimplificationForCustomFunctions = false; // false is default, but using explicit valueto make it obvious

                var query = context.Blogs.Select(b => new { b.Id, Len = CustomFunctions.MyCustomFunc(b.Name) }).Where(b => b.Len > 10);
                QueryTestHelpers.VerifyDbQuery(query, expectedSql);
            }
        }
Ejemplo n.º 17
0
        protected void PrintFooter()
        {
            try
            {
                //Align Center
                _thermalPrinterGeneric.SetAlignCenter();

                //Set Font Size: Small
                _thermalPrinterGeneric.SetFont(1);

                //User : Terminal
                _thermalPrinterGeneric.WriteLine(string.Format("{0} - {1}", GlobalFramework.LoggedUser.Name, GlobalFramework.LoggedTerminal.Designation));
                _thermalPrinterGeneric.LineFeed();

                //Printed On | Company|App|Version
                _thermalPrinterGeneric.WriteLine(string.Format("{1}: {2}{0}{3}: {4} {5}"
                                                               , Environment.NewLine
                                                               , CustomFunctions.Res("global_printed_on_date")
                                                               , FrameworkUtils.CurrentDateTimeAtomic().ToString(SettingsApp.DateTimeFormat)
                                                               , _customVars["APP_COMPANY"]
                                                               , _customVars["APP_NAME"]
                                                               , _customVars["APP_VERSION"]
                                                               )
                                                 ); /* IN009211 */

                //Reset Font Size: Normal
                _thermalPrinterGeneric.SetFont(0);

                //Line Feed
                _thermalPrinterGeneric.LineFeed();

                //Reset to Left
                _thermalPrinterGeneric.SetAlignLeft();

                //Finish With Cut and Print Buffer
                //TK016249 - Impressoras - Diferenciação entre Tipos
                _thermalPrinterGeneric.Cut(true, GlobalFramework.LoggedTerminal.ThermalPrinter.ThermalCutCommand);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 18
0
    /// <summary>Updates the AI's destination every frame</summary>
    void Update()
    {
        if (ai != null && GameManager.instance.isInWeaponSelection == false)
        {
            Vector3 destination = CustomFunctions.GetClosestPlayerPosition(this.transform.position);
            ai.destination = destination;

            //print(Vector2.Distance(destination, this.transform.position));

            if (Vector2.Distance(destination, this.transform.position) < 4f)
            {
                ai.maxSpeed = 0f;
            }
            else
            {
                ai.maxSpeed = initialMaxSpeed;
            }
        }
    }
Ejemplo n.º 19
0
 public bool Any()
 {
     return(HubVariables.Any() ||
            Datajobs.Any() ||
            Datalinks.Any() ||
            Connections.Any() ||
            Tables.Any() ||
            ColumnValidations.Any() ||
            CustomFunctions.Any() ||
            FileFormats.Any() ||
            RemoteAgentHubs.Any() ||
            DatalinkTests.Any() ||
            Views.Any() ||
            Apis.Any() ||
            Dashboards.Any() ||
            ListOfValues.Any() ||
            Tags.Any() ||
            TagObjects.Any());
 }
Ejemplo n.º 20
0
        public async Task <bool> GenerateImagesAndThumbnailsFromUrl()
        {
            var books = _dbContext.Books.Include(x => x.Image);

            foreach (var book in books)
            {
                if (book.Image == null && !string.IsNullOrEmpty(book.ImageUrl))
                {
                    var data     = CustomFunctions.ImageToByteArray(book.ImageUrl);
                    var newImage = new Image {
                        Data = data
                    };
                    book.Image = newImage;
                }

                if (book.Thumbnail == null && !string.IsNullOrEmpty(book.ThumbnailUrl))
                {
                    System.Drawing.Image img;
                    System.Drawing.Image thumb;

                    using (var ms = new MemoryStream(book.Image.Data))
                    {
                        img = System.Drawing.Image.FromStream(ms);
                    }

                    using (MemoryStream ms = new MemoryStream())
                    {
                        thumb = img.GetThumbnailImage(300, 390, () => false, IntPtr.Zero);
                        thumb.Save(ms, ImageFormat.Jpeg);
                        var newThumbnail = new Thumbnail {
                            Data = ms.ToArray()
                        };
                        book.Thumbnail = newThumbnail;
                    }
                }
            }

            await _dbContext.SaveChangesAsync();

            return(true);
        }
Ejemplo n.º 21
0
    void Shoot()
    {
        if (playerController == null)
        {
            playerController = GetComponent <PlayerController>();
        }

        if (playerHealth == null)
        {
            playerHealth = GetComponent <PlayerHealth>();
        }

        if (currentWeaponAction != null)
        {
            if (playerController.CanMove() || playerHealth.currentParryState == PlayerHealth.ParryState.IsParrying)
            {
                if (playerHealth.currentParryState == PlayerHealth.ParryState.IsParrying)
                {
                    playerHealth.StopParry();
                }

                if (currentWeaponState == WeaponState.ReadyToShoot)
                {
                    if (currentAmmo > 0)
                    {
                        currentWeaponAction.Shoot();
                        CameraShaker.Instance.ShakeOnce(1f, 2f, 0.1f, 0.1f);
                        CustomFunctions.PlaySound(GameManager.instance.weaponDatabase.allWeapons[currentWeapon].weaponShootSound);
                        currentWeaponState = WeaponState.WaitingForNextShot;
                        RemoveAmmo();
                        StartCoroutine(WaitForNextShot());
                        if (currentWeaponAction.OnShoot != null)
                        {
                            currentWeaponAction.OnShoot();
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 22
0
    public void TakeHitEffect(float damageAmount, GameObject playerThatShot)
    {
        if (currentParryState != ParryState.IsParrying)
        {
            RefreshDamageDisplay();
            CustomFunctions.HitPause();
            CustomFunctions.PlaySound(getHitSound);
            DisplayDamageOnMap(damageAmount, false);
            StopCoroutine(HitEffectSpriteBlink());
            StartCoroutine(HitEffectSpriteBlink());
        }
        else
        {
            ResetParry();
            CustomFunctions.PlaySound(parryHitSound);
            RefreshDamageDisplay();
            DisplayDamageOnMap(damageAmount, true);
            CustomFunctions.HitPause();
        }

        //print("Take hit effect with current health " + currentHealth);
    }
Ejemplo n.º 23
0
        public void Rule_FilterOverProject_does_not_promote_to_single_Select_if_custom_function_and_does_opt_in()
        {
            var expectedSql =
                @"SELECT 
    [Project1].[Id] AS [Id], 
    [Project1].[C1] AS [C1]
    FROM ( SELECT 
        [Extent1].[Id] AS [Id], 
        [SqlServer].[MyCustomFunc]([Extent1].[Name]) AS [C1]
        FROM [dbo].[Blogs] AS [Extent1]
    )  AS [Project1]
    WHERE ([Project1].[Id] > 10) AND ([Project1].[C1] > 10)";

            using (var context = new BlogContext())
            {
                context.Configuration.UseDatabaseNullSemantics = true;
                context.Configuration.DisableFilterOverProjectionSimplificationForCustomFunctions = true;

                var query = context.Blogs.Select(b => new { b.Id, Len = CustomFunctions.MyCustomFunc(b.Name) }).Where(b => b.Id > 10 && b.Len > 10);
                QueryTestHelpers.VerifyDbQuery(query, expectedSql);
            }
        }
Ejemplo n.º 24
0
        public List <IItem> GetInventoryCategory(string category)
        {
            switch (category)
            {
            case "Zbraně na blízko":
                return(CustomFunctions.ConvertToIItemList(MeleeWeapons));

            case "Zbraně na dálku":
                return(CustomFunctions.ConvertToIItemList(RangedWeapons));

            case "Štíty":
                return(CustomFunctions.ConvertToIItemList(Shields));

            case "Munice":
                return(CustomFunctions.ConvertToIItemList(Amunition));

            case "Brnění":
                return(CustomFunctions.ConvertToIItemList(Armors));

            default:
                return(CustomFunctions.ConvertToIItemList(Inventory[category]));
            }
        }
Ejemplo n.º 25
0
        //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
        //PreferenceParameters

        //Alias to Reports.CustomFunctions
        public static string GetPreferenceParameter(string pToken)
        {
            return(CustomFunctions.Pref(pToken));
        }
Ejemplo n.º 26
0
 private void Awake()
 {
     instance = this;
 }
Ejemplo n.º 27
0
        /// <summary>
        /// Adds one of the properties to the relevant area.
        /// </summary>
        /// <param name="property"></param>
        /// <param name="operation"></param>
        public bool Add(object property, EImportAction operation)
        {
            try
            {
                switch (property)
                {
                case DexihHubVariable a:
                    HubVariables.Add(a, operation);
                    break;

                case DexihDatajob a:
                    Datajobs.Add(a, operation);
                    break;

                case DexihDatalink a:
                    Datalinks.Add(a, operation);
                    break;

                case DexihConnection a:
                    Connections.Add(a, operation);
                    break;

                case DexihTable a:
                    Tables.Add(a, operation);
                    break;

                case DexihColumnValidation a:
                    ColumnValidations.Add(a, operation);
                    break;

                case DexihCustomFunction a:
                    CustomFunctions.Add(a, operation);
                    break;

                case DexihFileFormat a:
                    FileFormats.Add(a, operation);
                    break;

                case DexihRemoteAgentHub a:
                    RemoteAgentHubs.Add(a, operation);
                    break;

                case DexihDatalinkTest a:
                    DatalinkTests.Add(a, operation);
                    break;

                case DexihView a:
                    Views.Add(a, operation);
                    break;

                case DexihApi a:
                    Apis.Add(a, operation);
                    break;

                case DexihDashboard a:
                    Dashboards.Add(a, operation);
                    break;

                case DexihListOfValues a:
                    ListOfValues.Add(a, operation);
                    break;

                case DexihTag a:
                    Tags.Add(a, operation);
                    break;

                case DexihTagObject a:
                    TagObjects.Add(a, operation);
                    break;

                default:
                    return(false);
                }

                return(true);
            } catch (Exception ex)
            {
                throw new AggregateException($"Failed to add item.  {ex.Message}", ex);
            }
        }
 public async Task <Stream> DownloadFullReportFile(DeviceEnrollmentBulkCreate model)
 {
     return(await CustomFunctions.DownloadFullReportFile(this, model));
 }
Ejemplo n.º 29
0
        public static void Print(sys_configurationprinters pPrinter)
        {
            try
            {
                ThermalPrinterGeneric thermalPrinterGeneric = new ThermalPrinterGeneric(pPrinter);

                List <TicketColumn> columns = new List <TicketColumn>();
                columns.Add(new TicketColumn("Code", "Code", 6, TicketColumnsAlign.Right));
                columns.Add(new TicketColumn("Designation", CustomFunctions.Res("global_designation"), 0));
                columns.Add(new TicketColumn("Quantity", "Qnt", 7, TicketColumnsAlign.Right, typeof(decimal), "{0:0.00}"));
                columns.Add(new TicketColumn("UnitMeasure", "UM", 3));
                columns.Add(new TicketColumn("Price", "Preço", 10, TicketColumnsAlign.Right, typeof(decimal), "{0:0.00}"));
                columns.Add(new TicketColumn("Tax", "Taxa", 7, TicketColumnsAlign.Right, typeof(decimal), "{0:0.00}"));
                columns.Add(new TicketColumn("Discount", "Desc", 7, TicketColumnsAlign.Right, typeof(decimal), "{0:0.00}"));
                columns.Add(new TicketColumn("Total", "Total", 11, TicketColumnsAlign.Right, typeof(decimal), "{0:0.00}"));

                string sql = string.Format(@"
                    SELECT 
                        Code,Designation,Quantity,UnitMeasure,Price,Vat,Discount,TotalFinal
                    FROM 
                        fin_documentfinancedetail 
                    WHERE 
                        DocumentMaster = '{0}'
                    ORDER 
                        BY Ord
                    ;",
                                           SettingsApp.XpoPrintFinanceDocument
                                           );
                TicketTable ticketTable = new TicketTable(sql, columns, thermalPrinterGeneric.MaxCharsPerLineSmall);
                ticketTable.Print(thermalPrinterGeneric);
                //Cut
                thermalPrinterGeneric.Cut(true);
                //Print Buffer
                thermalPrinterGeneric.PrintBuffer();

                //Get Result Objects
                ResultFRBODocumentFinanceMaster           FRBOHelperResponseProcessReportFinanceDocument = FRBOHelper.GetFRBOFinanceDocument(SettingsApp.XpoPrintFinanceDocument);
                List <FRBODocumentFinanceMasterView>      gcDocumentFinanceMaster      = FRBOHelperResponseProcessReportFinanceDocument.DocumentFinanceMaster.List;
                List <FRBODocumentFinanceDetail>          gcDocumentFinanceDetail      = FRBOHelperResponseProcessReportFinanceDocument.DocumentFinanceMaster.List[0].DocumentFinanceDetail;
                List <FRBODocumentFinanceMasterTotalView> gcDocumentFinanceMasterTotal = FRBOHelperResponseProcessReportFinanceDocument.DocumentFinanceMaster.List[0].DocumentFinanceMasterTotal;;

                _log.Debug(string.Format("DocumentNumber: [{0}]", gcDocumentFinanceMaster[0].DocumentNumber));

                foreach (FRBODocumentFinanceDetail item in gcDocumentFinanceDetail)
                {
                    _log.Debug(string.Format("Designation: [{0}], Price: [{1}]", item.Designation, item.Price));
                }

                foreach (FRBODocumentFinanceMasterTotalView item in gcDocumentFinanceMasterTotal)
                {
                    _log.Debug(string.Format("Designation: [{0}], Value :[{1}]", item.Designation, item.Value));
                }

                Dictionary <string, string> CustomVars = GlobalFramework.FastReportCustomVars;
                _log.Debug(string.Format("Company_Name: [{0}]", CustomVars["Company_Name"]));

                //ThermalPrinterFinanceDocument thermalPrinterFinanceDocument = new ThermalPrinterFinanceDocument(pPrinter);
                //thermalPrinterFinanceDocument.Print();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 30
0
        public override void Initialize()
        {
            //Aimsharp.DebugMode();
            Aimsharp.PrintMessage("Vid Shadow - v 1.0", Color.Blue);
            Aimsharp.PrintMessage("These macros can be used for manual control:", Color.Blue);
            Aimsharp.PrintMessage("/xxxxx NoAOE", Color.Blue);
            Aimsharp.PrintMessage("--Toggles AOE mode on/off.", Color.Blue);
            Aimsharp.PrintMessage(" ");
            Aimsharp.PrintMessage("/xxxxx Potions", Color.Blue);
            Aimsharp.PrintMessage("--Toggles using buff potions on/off.", Color.Blue);
            Aimsharp.PrintMessage(" ");
            Aimsharp.PrintMessage("/xxxxx SaveCooldowns", Color.Blue);
            Aimsharp.PrintMessage("--Toggles the use of big cooldowns on/off.", Color.Blue);
            Aimsharp.PrintMessage(" ");
            Aimsharp.PrintMessage("/xxxxx CouncilDotsOff", Color.Blue);
            Aimsharp.PrintMessage("--Will keep SW:P and VT up on focus and Boss 1-4.", Color.Blue);
            Aimsharp.PrintMessage("/xxxxx StartCombat", Color.Blue);
            Aimsharp.PrintMessage("--Will initiate combat on by itself.", Color.Blue);
            Aimsharp.PrintMessage(" ");
            Aimsharp.PrintMessage("--Replace xxxxx with first 5 letters of your addon, lowercase.", Color.Blue);


            Aimsharp.Latency    = 50;
            Aimsharp.QuickDelay = 125;
            Aimsharp.SlowDelay  = 250;

            MajorPower  = GetDropDown("Major Power");
            TopTrinket  = GetDropDown("Top Trinket");
            BotTrinket  = GetDropDown("Bot Trinket");
            FiveLetters = GetString("First 5 Letters of the Addon:");
            AmountHP    = GetSlider("Don't dot below HP Amount");
            PercentHP   = GetSlider("Don't dot below HP%");


            Spellbook.Add(MajorPower);
            Spellbook.Add("Agony");
            Spellbook.Add("Corruption");
            Spellbook.Add("Seed of Corruption");
            Spellbook.Add("Unstable Affliction");
            Spellbook.Add("Summon Darkglare");
            Spellbook.Add("Unending Resolve");
            Spellbook.Add("Command Demon");
            Spellbook.Add("Malefic Rapture");
            Spellbook.Add("Siphon Life");
            Spellbook.Add("Vile Taint");
            Spellbook.Add("Phantom Singularity");
            Spellbook.Add("Shadow Bolt");
            Spellbook.Add("Drain Soul");
            Spellbook.Add("Haunt");
            Spellbook.Add("Dark Soul: Misery");
            Spellbook.Add("Unending Resolve");

            Items.Add("Healthstone");


            Buffs.Add("Bloodlust");
            Buffs.Add("Heroism");
            Buffs.Add("Time Warp");
            Buffs.Add("Ancient Hysteria");
            Buffs.Add("Netherwinds");
            Buffs.Add("Drums of Rage");
            Buffs.Add("Lifeblood");
            Buffs.Add("Void Miasma");



            Debuffs.Add("Concentrated Flame");
            Debuffs.Add("Corruption");
            Debuffs.Add("Siphon Life");
            Debuffs.Add("Agony");
            Debuffs.Add("Unstable Affliction");
            Debuffs.Add("Vile Taint");
            Debuffs.Add("Phantom Singularity");
            Debuffs.Add("Seed of Corruption");



            Items.Add(TopTrinket);
            Items.Add(BotTrinket);
            Items.Add(GetDropDown("Potion Type"));

            Macros.Add(TopTrinket, "/use " + TopTrinket);
            Macros.Add(BotTrinket, "/use " + BotTrinket);
            Macros.Add("TopTrink", "/use 13");
            Macros.Add("BotTrink", "/use 14");
            Macros.Add("potion", "/use " + GetDropDown("Potion Type"));
            Macros.Add("Healthstone", "/use Healthstone");
            Macros.Add("crash cursor", "/cast [@cursor] Shadow Crash");
            Macros.Add("MassDispel", "/cast [@cursor] Mass Dispel");
            Macros.Add("MassDispelOff", "/" + FiveLetters + " MassDispel");
            Macros.Add("S2MOff", "/" + FiveLetters + " S2M");
            Macros.Add("DispelOff", "/" + FiveLetters + " DispelMagic");
            Macros.Add("DispersionOff", "/" + FiveLetters + " Dispersion");
            Macros.Add("MindControlOff", "/" + FiveLetters + " MindControl");
            Macros.Add("PsychicScreamOff", "/" + FiveLetters + " PsychicScream");
            Macros.Add("PsychicHorrorOff", "/" + FiveLetters + " PsychicHorror");
            Macros.Add("DispelMagicOff", "/" + FiveLetters + " DispelMagic");

            Macros.Add("AgonyFocus", "/cast [@focus] Agony");
            Macros.Add("AgonyBoss1", "/cast [@boss1] Agony");
            Macros.Add("AgonyBoss2", "/cast [@boss2] Agony");
            Macros.Add("AgonyBoss3", "/cast [@boss3] Agony");
            Macros.Add("AgonyBoss4", "/cast [@boss4] Agony");

            Macros.Add("CorruptionFocus", "/cast [@focus] Corruption");
            Macros.Add("CorruptionBoss1", "/cast [@boss1] Corruption");
            Macros.Add("CorruptionBoss2", "/cast [@boss2] Corruption");
            Macros.Add("CorruptionBoss3", "/cast [@boss3] Corruption");
            Macros.Add("CorruptionBoss4", "/cast [@boss4] Corruption");

            Macros.Add("SLFocus", "/cast [@focus] Siphon Life");
            Macros.Add("SLBoss1", "/cast [@boss1] Siphon Life");
            Macros.Add("SLBoss2", "/cast [@boss2] Siphon Life");
            Macros.Add("SLBoss3", "/cast [@boss3] Siphon Life");
            Macros.Add("SLBoss4", "/cast [@boss4] Siphon Life");



            CustomCommands.Add("NoAOE");
            CustomCommands.Add("Prepull");
            CustomCommands.Add("Potions");
            CustomCommands.Add("SaveCooldowns");
            CustomCommands.Add("MassDispel");
            CustomCommands.Add("JustEssences");
            CustomCommands.Add("CouncilDotsOff");
            CustomCommands.Add("SavePS");
            CustomCommands.Add("StartCombat");

            CustomFunctions.Add("UACount", "local UACount = 0\nfor i=1,20 do\nlocal unit = \"nameplate\" .. i\nif UnitExists(unit) then\nif UnitCanAttack(\"player\", unit) then\nfor j = 1, 40 do\nlocal name,_,_,_,_,_,source = UnitDebuff(unit, j)\nif name == \"Unstable Affliction\" and source == \"player\" then\nUACount = UACount + 1\nend\nend\nend\nend\nend\nreturn UACount");
            CustomFunctions.Add("CorruptionCount", "local CorruptionCount = 0\nfor i=1,20 do\nlocal unit = \"nameplate\" .. i\nif UnitExists(unit) then\nif UnitCanAttack(\"player\", unit) then\nfor j = 1, 40 do\nlocal name,_,_,_,_,_,source = UnitDebuff(unit, j)\nif name == \"Corruption\" and source == \"player\" then\nCorruptionCount = CorruptionCount + 1\nend\nend\nend\nend\nend\nreturn CorruptionCount");
            CustomFunctions.Add("CorruptionTargets", "local CorruptionTargets = 0\nfor i=1,20 do\nlocal unit = \"nameplate\" .. i\nif UnitExists(unit) then\nif UnitCanAttack(\"player\", unit) and UnitHealthMax(unit) > 90000 and UnitHealth(unit) > 60000 then\nCorruptionTargets = CorruptionTargets + 1\nend\nend\nend\nreturn CorruptionTargets");
            CustomFunctions.Add("SoCCount", "local SoCCount = 0\nfor i=1,20 do\nlocal unit = \"nameplate\" .. i\nif UnitExists(unit) then\nif UnitCanAttack(\"player\", unit) then\nfor j = 1, 40 do\nlocal name,_,_,_,_,_,source = UnitDebuff(unit, j)\nif name == \"Seed of Corruption\" and source == \"player\" then\nSoCCount = SoCCount + 1\nend\nend\nend\nend\nend\nreturn SoCCount");

            CustomFunctions.Add("TargetID",
                                "local TargetID = 0;" +
                                "\nif UnitExists(\"target\") then" +
                                "\nTargetID = tonumber(UnitGUID(\"target\"):match(\"-(%d+)-%x+$\"), 10);" +
                                "\nend" +
                                "\nreturn TargetID;"
                                );

            CustomFunctions.Add("Boss1ID",
                                "local Boss1ID = 0;" +
                                "\nif UnitExists(\"boss1\") and UnitCanAttack(\"player\", \"boss1\") then" +
                                "\nBoss1ID = tonumber(UnitGUID(\"boss1\"):match(\"-(%d+)-%x+$\"), 10);" +
                                "\nend" +
                                "\nreturn Boss1ID;"
                                );

            CustomFunctions.Add("Boss2ID",
                                "local Boss2ID = 0;" +
                                "\nif UnitExists(\"boss2\") and UnitCanAttack(\"player\", \"boss2\") then" +
                                "\nBoss2ID = tonumber(UnitGUID(\"boss2\"):match(\"-(%d+)-%x+$\"), 10);" +
                                "\nend" +
                                "\nreturn Boss2ID;"
                                );

            CustomFunctions.Add("Boss3ID",
                                "local Boss3ID = 0;" +
                                "\nif UnitExists(\"boss3\") and UnitCanAttack(\"player\", \"boss3\") then" +
                                "\nBoss3ID = tonumber(UnitGUID(\"boss3\"):match(\"-(%d+)-%x+$\"), 10);" +
                                "\nend" +
                                "\nreturn Boss3ID;"
                                );

            CustomFunctions.Add("Boss4ID",
                                "local Boss4ID = 0;" +
                                "\nif UnitExists(\"boss4\") and UnitCanAttack(\"player\", \"boss4\") then" +
                                "\nBoss4ID = tonumber(UnitGUID(\"boss4\"):match(\"-(%d+)-%x+$\"), 10);" +
                                "\nend" +
                                "\nreturn Boss4ID;"
                                );
        }