Home - SmarchSoftware/amazo GitHub Wiki

Welcome to the Amazo wiki!


Amazo Damage Types

If you have ACL enabled, you will need the 'amazo.acl.index' permission to view this page.

By default pagination is set to 15 items. Amazo Configuration will allow you to change that value for the damage types.

You can click on the "+ Add New Damage Type" button to create new Amazo damage types.


Create Damage Type

If you have ACL enabled, you will need the 'amazo.acl.create' permission to access this page.

From the Damage Types index page, you will see a large "Add New Damage Type" button (like the blue one in the image below)

Clicking that button will bring you to a form to input your new role.

:hand: Note All of the fields are mandatory except for notes. You will notice an "+ Add Damage Modifiers" button. By default, those are all hidden since they are completely optional and take up some real estate. If you wish to add a modifier while creating, click that button to get access to them.

The name field is a user-friendly name for your personal reference within your application. It is not used for any methods, that is the purpose of the slug field.

For example, you can use the Name "Super Duper Damaging HELLFIRE" for user-friendly naming and the slug of "fire".

notes Optional - A convenience field to keep any info/notes on your damage types if you wish.

enabled Is this damage type currently in use and selectable?


Show Damage Type

If you have ACL enabled, you will need the 'amazo.acl.show' permission to access this page.

You will be able to click on the View button for that damage type and be brought to a page that will show you information about that damage type, with a link to add damage type modifiers if you wish.

:hand: NOTE In the image above, the View button is coloured blue and is the first in the group.


Edit Damage Type

If you have ACL enabled, you will need the 'amazo.acl.edit' permission to access this page.

You will be able to click on the Edit button for that Damage Type and be brought to a page that will let you edit the damage type if you wish.

:hand: NOTE In the image above, the Edit button is coloured dark grey and is the second in the group.

The same fields in the Create Damage Type section (above) will be available with the exception of the modifiers. There will be a link to the Modifiers section to add / delete modifiers for that damage type.

:hand: NOTE In the image above, the Modifiers button is coloured orange and is the above the Delete button.


Destroy Damage Type

If you have ACL enabled, you will need the 'amazo.acl.destroy' permission to access this page or to destroy objects.

From the index page, or edit page, you will be able to click on the Delete button for that Damage Type.

:hand: NOTE In the image above, the Delete button is coloured red and is the last in the group.

If you click that button, your Damage Type will be deleted.

:bulb: TIP - You should probably have some method in your master layout that requires confirmation of a delete.

For example, if you are using the SmarchSoftware\Watchtower packaged layouts, you will need to confirm that you want to delete the Damage Type.

:hand: NOTE If you confirm and delete the Damage Type, it is gone. There is no going back.


Modifiers

If you have ACL enabled, you will need the 'amazo.acl.show_mods' permission to access this page and 'amazo.acl.add_mods' and 'amazo.acl.destroy_mods' to make any changes to the modifiers.

From the index page you will be able to click on the Modifiers button for any given Damage Type. (In the following image it is the third available button and it is coloured orange)

That will take you to a page where you can add more modifiers to the current damage type.

There is a big ? right beside the title. Clicking on that will open a hidden view which shows the following text which explains how the modifiers work and show an example of what is returned by the modifier methods in case you need the information again.

Damage modifiers are completely optional. Say, for example, you already have a damage type called "Cold". Now say you wish to have an "Ice" damage type that deals "double" the damage "Cold" performs whenever it hits. So you would create your "Ice" damage type and then give it a damage modifier to the "Cold" damage type with a "mulitplier" of "2.000". Now whenever your "Ice" damage type is applied it will double whatever the "Cold" damage was as well.

    $damage = "100"; //determined earlier in code.

    // i.e. $resource = "Cold" damage type object
    $totalDamage = $resource->addModifierDamage($damage)->totalDamage;
    //returns 300

    // addModifierDamage() returns an object with all the modifier and damage information
    dd( $resource->addModifierDamage($damage) );
    // returns
    public startingDamage -> float 100
    public modifiersDamage -> float 200
    public modifiersDamageMath -> string(3) "200"
    public totalDamage -> integer 300
    public totalDamageMath -> string(11) "100 + (200)"
      →public modifiers -> stdClass(1)
        →public 0 -> stdClass(8)
          public message -> string(42) "Ice generated 200 damage (100 * 2.0000)"
          public parentName -> string(4) "Cold"
          public name -> string(3) "Ice"
          public modifierAmount -> float 2.0000
          public damage -> float 200
          public cumulative -> bool FALSE
          public cumulativeAsString -> string(4) "Base"
          public operator -> string(1) "*"
          public bcOperator -> string(5) "bcmul"

Notes

  • Modifiers can apply to either the base/starting damage or the total damage ("cumulative").
  • "Cumulative" modifiers run after base modifiers.
  • Additionals (+/-) are performed before multipliers (*).

You will also be able to see and remove the current modifiers from that damage type as well on the bottom half of the page. It will also give you a quick example of what kind of changes your modifiers are making to that damage type, based on a starting point of "100" damage.

If you would like to know exactly the damage total is determined, you can click on the little "Explain" button to the right of the damage example. It will show what damage each modifier generated and how it affected the total. Please bear in mind the Notes above about the order in which the modifiers are performed.

#