lipefl / swade-tools

A Fondry VTT module with automations for Savage Worlds (SWADE)
15 stars 13 forks source link

Group Roll #265

Closed EternalRider closed 11 months ago

EternalRider commented 1 year ago

my fork has broken and I don't know how to fix it, so I use Issue to show.

ItemDialog.js - showDialog - add

        if (!this.actor.isWildcard){
            content+=`<div class="swadetools-raise swadetools-raise-${item.type}"><label><input type="checkbox" id="wilddie" value="1"><strong>${gb.trans('GroupRoll','SWADE')}</strong></label></div>`;
        }

ItemDialog.js - processItemFormDialog - add

            if (html.find("#wilddie")[0]?.checked){
                charRoll.addFlag('wilddie',1);
            }

CharRoll.js - rollAtt - replace

        let wildCard=this.actor.isWildcard || (this.flagUpdate?.wilddie != undefined);
        let wildDie=false;

        if (wildCard){
            wildDie=this.actor.system.attributes[attribute]["wild-die"].sides;
         //   console.log(wildDie);
        } 

        this.flavor+=`<div>${gb.trans(gb.attrlang[attribute],"SWADE")}`;
        if (this.flagUpdate?.wilddie != undefined) {
            this.flavor+=`, ${gb.trans("GroupRoll","SWADE")}</div>`;
        } else {
            this.flavor+=`</div>`;
        }

CharRoll.js - rollSkill - replace

        let wildCard=this.actor.isWildcard || (this.flagUpdate?.wilddie != undefined);
// other code skip
        this.flavor+=`<div>${skillName}`;
        if (this.flagUpdate?.wilddie != undefined) {
            this.flavor+=`, ${gb.trans("GroupRoll","SWADE")}</div>`;
        } else {
            this.flavor+=`</div>`;
        }

it works like : image

lipefl commented 11 months ago

Added in v1.14.7 You have to check the option "Show Group Roll option for Extras"