Skip to content

Commit

Permalink
Merge pull request #460 from shadowfoundry/dev
Browse files Browse the repository at this point in the history
v11.0.13
  • Loading branch information
karmaroms committed Jan 16, 2024
2 parents 0007128 + fe4ed15 commit e7cac60
Show file tree
Hide file tree
Showing 18 changed files with 198 additions and 93 deletions.
7 changes: 7 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,13 @@
"SR5.AmmunitionType": "Ammunition Type",
"SR5.AmmunitionTypeAPDS": "APDS",
"SR5.AmmunitionTypeArrow": "Arrow",
"SR5.AmmunitionTypeArrowBarbedHead": "Barbed Head",
"SR5.AmmunitionTypeArrowExplosiveHead": "Explosive Head",
"SR5.AmmunitionTypeArrowHammerhead": "Hammerhead",
"SR5.AmmunitionTypeArrowIncendiaryHead": "Incendiary Head",
"SR5.AmmunitionTypeArrowScreamerHead": "Screamer Head",
"SR5.AmmunitionTypeArrowStickNShock": "Arrow Stick-n-Shock",
"SR5.AmmunitionTypeArrowStaticShaft": "Static Shaft",
"SR5.AmmunitionTypeAssaultCannon": "Assault Cannon",
"SR5.AmmunitionTypeAV": "Anti-Vehicle",
"SR5.AmmunitionTypeBolt": "Bolt",
Expand Down
7 changes: 7 additions & 0 deletions lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,13 @@
"SR5.AmmunitionType": "Type de munitions",
"SR5.AmmunitionTypeAPDS": "APDS",
"SR5.AmmunitionTypeArrow": "Flèche",
"SR5.AmmunitionTypeArrowBarbedHead": "Pointe barbelée",
"SR5.AmmunitionTypeArrowExplosiveHead": "Pointe explosive",
"SR5.AmmunitionTypeArrowHammerhead": "Pointe large",
"SR5.AmmunitionTypeArrowIncendiaryHead": "Pointe incendiaire",
"SR5.AmmunitionTypeArrowScreamerHead": "Pointe hurleuse",
"SR5.AmmunitionTypeArrowStickNShock": "Pointe Stick-n-Shock",
"SR5.AmmunitionTypeArrowStaticShaft": "Hampe électrostatique",
"SR5.AmmunitionTypeAssaultCannon": "Canon d'assaut",
"SR5.AmmunitionTypeAV": "Anti-Véhicule",
"SR5.AmmunitionTypeBolt": "Carreau",
Expand Down
17 changes: 17 additions & 0 deletions scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,13 @@ SR5.ammunitionCrossbowTypes = {
SR5.ammunitionBowTypes = {
arrow : "SR5.AmmunitionTypeArrow",
arrowInjection : "SR5.AmmunitionTypeInjectionArrow",
arrowBarbedHead : "SR5.AmmunitionTypeArrowBarbedHead",
arrowExplosiveHead : "SR5.AmmunitionTypeArrowExplosiveHead",
arrowHammerhead : "SR5.AmmunitionTypeArrowHammerhead",
arrowIncendiaryHead : "SR5.AmmunitionTypeArrowIncendiaryHead",
arrowScreamerHead : "SR5.AmmunitionTypeArrowScreamerHead",
arrowStickNShock : "SR5.AmmunitionTypeArrowStickNShock",
arrowStaticShaft : "SR5.AmmunitionTypeArrowStaticShaft",
};

//Types de munitions de lance grenade
Expand Down Expand Up @@ -2070,6 +2077,16 @@ SR5.resonanceActions = {
threadComplexForm : "SR5.MatrixActionThreadComplexForm",
};

// Resonance Actions with rolled
SR5.resonanceActionsRolled = {
compileSprite : "SR5.MatrixActionCompileSprite",
decompileSprite : "SR5.MatrixActionDecompileSprite",
eraseResonanceSignature : "SR5.MatrixActionEraseResonanceSignature",
killComplexForm : "SR5.MatrixActionKillComplexForm",
registerSprite : "SR5.MatrixActionRegisterSprite",
threadComplexForm : "SR5.MatrixActionThreadComplexForm",
};

// Kill Code Actions
SR5.matrixKillCodeActions = {
calibration : "SR5.MatrixActionCalibration",
Expand Down
2 changes: 2 additions & 0 deletions scripts/entities/actors/characterSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ export class SR5ActorSheet extends ActorSheetSR5 {
case "itemMartialArt" :
if (itemData.system.actionType === "permanent") itemData.system.isActive = true;
return super._onDropItemCreate(itemData);
case "itemVehicleMod":
return ui.notifications.info(game.i18n.localize('SR5.INFO_ForbiddenItemType'));
default:
return super._onDropItemCreate(itemData);
}
Expand Down
12 changes: 6 additions & 6 deletions scripts/entities/actors/deviceSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ export class SR5AppareilSheet extends ActorSheetSR5 {
/** @override */
async _onDropItemCreate(itemData) {
switch(itemData.type){
case "itemEffect":
return super._onDropItemCreate(itemData);
default:
ui.notifications.info(game.i18n.localize('SR5.INFO_ForbiddenItemType'));
return;
}
case "itemEffect":
return super._onDropItemCreate(itemData);
default:
ui.notifications.info(game.i18n.localize('SR5.INFO_ForbiddenItemType'));
return;
}
}
}
9 changes: 9 additions & 0 deletions scripts/entities/actors/entityActor-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ export class SR5_ActorHelper {
}

sideKickData = mergeObject(sideKickData, {
"system.sideKickPrototypeToken": itemData.sideKickPrototypeToken,
"system.type": itemData.type,
"system.force.base": itemData.itemRating,
"system.isBounded": itemData.isBounded,
Expand All @@ -502,6 +503,7 @@ export class SR5_ActorHelper {
}

sideKickData = mergeObject(sideKickData, {
"system.sideKickPrototypeToken": itemData.sideKickPrototypeToken,
"system.type": itemData.type,
"system.level": itemData.itemRating,
"system.isRegistered": itemData.isRegistered,
Expand All @@ -526,6 +528,7 @@ export class SR5_ActorHelper {
for (let vehicles of itemData.vehicles) baseItems.push(vehicles);

sideKickData = mergeObject(sideKickData, {
"system.sideKickPrototypeToken": itemData.sideKickPrototypeToken,
"system.biography.description": itemData.description,
"system.biography.background": itemData.gameEffect,
"system.biography.characterMetatype": itemData.metatype,
Expand Down Expand Up @@ -585,6 +588,7 @@ export class SR5_ActorHelper {
let ownerActorObject = ownerActor.toObject(false);

sideKickData = mergeObject(sideKickData, {
"system.sideKickPrototypeToken": itemData.sideKickPrototypeToken,
"system.creatorId": actorId,
"system.creatorItemId": item._id,
"system.type": itemData.type,
Expand Down Expand Up @@ -656,6 +660,7 @@ export class SR5_ActorHelper {
if (a.type === "itemPower") powers.push(a);
}
modifiedItem.img = actor.img;
modifiedItem.system.sideKickPrototypeToken = actor.prototypeToken;
modifiedItem.system.services.value = actor.system.services.value;
modifiedItem.system.services.max = actor.system.services.max;
if (actor.system.type === "watcher" || actor.system.type === "homunculus"){
Expand Down Expand Up @@ -686,6 +691,7 @@ export class SR5_ActorHelper {
if (a.type === "itemSpritePower") spritePowers.push(a);
}
modifiedItem.img = actor.img;
modifiedItem.system.sideKickPrototypeToken = actor.prototypeToken;
modifiedItem.system.decks = decks;
modifiedItem.system.spritePowers = spritePowers;
modifiedItem.system.tasks.value = actor.system.tasks.value;
Expand All @@ -710,6 +716,7 @@ export class SR5_ActorHelper {
if (a.type === "itemDevice") decks.push(a);
}
modifiedItem.img = actor.img;
modifiedItem.system.sideKickPrototypeToken = actor.prototypeToken;
modifiedItem.system.decks = decks;
if (actor.img != "systems/sr5/img/actors/actorAgent.svg" && modifiedItem.system.gameEffect.includes(actor.img) === false) {
if (modifiedItem.system.gameEffect.includes("SR-BioItemPortrait")) {
Expand Down Expand Up @@ -741,6 +748,7 @@ export class SR5_ActorHelper {
}
modifiedItem.name = actor.name;
modifiedItem.img = actor.img;
modifiedItem.system.sideKickPrototypeToken = actor.prototypeToken;
modifiedItem.system.language = language,
modifiedItem.system.knowledge = knowledge,
modifiedItem.system.weapons = weapons,
Expand Down Expand Up @@ -792,6 +800,7 @@ export class SR5_ActorHelper {
if (a.type === "itemVehicleMod") vehiclesMod.push(a);
}
modifiedItem.img = actor.img;
modifiedItem.system.sideKickPrototypeToken = actor.prototypeToken;
modifiedItem.system.autosoft = autosoft;
modifiedItem.system.weapons = weapons;
modifiedItem.system.ammunitions = ammunitions;
Expand Down
7 changes: 7 additions & 0 deletions scripts/entities/actors/entityActor.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,13 @@ export class SR5Actor extends Actor {
SR5_SystemHelpers.srLog(1, `Unknown '${this.type}' type in 'base _preCreate()'`);
}

if (this.system.sideKickPrototypeToken) {
mergeObject(createData, {
"prototypeToken": this.system.sideKickPrototypeToken,
});
console.log("sidekick: ", createData.prototypeToken);
};

this.updateSource(createData);
}

Expand Down
2 changes: 2 additions & 0 deletions scripts/entities/actors/gruntSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ export class SR5GruntSheet extends ActorSheetSR5 {
case "itemMartialArt" :
if (item.system.actionType === "permanent") item.system.isActive = true;
return super._onDropItemCreate(item);
case "itemVehicleMod":
return ui.notifications.info(game.i18n.localize('SR5.INFO_ForbiddenItemType'));
default:
return super._onDropItemCreate(item);
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/entities/actors/spriteSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class SR5SpriteSheet extends ActorSheetSR5 {
/** @override */
async _onDropItemCreate(itemData) {
switch(itemData.type){
case "spritePowers":
case "itemSpritePower":
case "itemEffect":
return super._onDropItemCreate(itemData);
default:
Expand Down
6 changes: 3 additions & 3 deletions scripts/entities/actors/utilityActor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1611,9 +1611,9 @@ export class SR5_CharacterUtility extends Actor {
case "actorGrunt":
switch (actorData.matrix.userMode) {
case "ar":
initMat.modifiers = initMat.modifiers.concat(initiatives.physicalInit.modifiers);
initMat.modifiers = initiatives.physicalInit.modifiers;
initMat.dice.base = 1;
initMat.dice.modifiers = initMat.dice.modifiers.concat(initiatives.physicalInit.dice.modifiers);
initMat.dice.modifiers = initiatives.physicalInit.dice.modifiers;
break;
case "coldsim":
SR5_EntityHelpers.updateModifier(initMat, game.i18n.localize('SR5.Intuition'), "linkedAttribute", attributes.intuition.augmented.value);
Expand All @@ -1623,7 +1623,7 @@ export class SR5_CharacterUtility extends Actor {
case "hotsim":
SR5_EntityHelpers.updateModifier(initMat, game.i18n.localize('SR5.Intuition'), "linkedAttribute", attributes.intuition.augmented.value);
SR5_EntityHelpers.updateModifier(initMat, actorData.matrix.deviceName, "device", matrixAttributes.dataProcessing.value);
SR5_EntityHelpers.updateModifier(initMat.dice, game.i18n.localize('SR5.VirtualRealityColdSimShort'), "matrixUserMode", 4);
SR5_EntityHelpers.updateModifier(initMat.dice, game.i18n.localize('SR5.VirtualRealityHotSimShort'), "matrixUserMode", 4);
break;
default:
SR5_SystemHelpers.srLog(1, `Unknown matrix userMode '${actorData.matrix.userMode}' in 'updateInitiativeMatrix()'`);
Expand Down
41 changes: 37 additions & 4 deletions scripts/entities/items/utilityItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,43 @@ export class SR5_UtilityItem extends Actor {
blastDamageFallOff = -4;
blastRadius = 6;
break;
case "arrow":
case "arrowInjection":
damageValue = itemData.ammunition.itemRating;
break;
case "arrow":
case "arrowInjection":
damageValue = itemData.ammunition.itemRating;
break;
case "arrowBarbedHead":
damageValue = itemData.ammunition.itemRating + 1;
break;
case "arrowExplosiveHead":
damageValue = itemData.ammunition.itemRating + 2;
armorPenetration = -1;
SR5_EntityHelpers.updateModifier(itemData.accuracy, game.i18n.localize('SR5AmmunitionTypeArrowExplosiveHead'), "ammunitionType", -1);
break;
case "arrowHammerhead":
damageValue = itemData.ammunition.itemRating + 1;
damageType = "stun";
armorPenetration = +2;
SR5_EntityHelpers.updateModifier(itemData.accuracy, game.i18n.localize('SR5.AmmunitionTypeArrowHammerhead'), "ammunitionType", -1); break;
case "arrowIncendiaryHead":
SR5_EntityHelpers.updateModifier(itemData.accuracy, game.i18n.localize('SR5.AmmunitionTypeArrowIncendiaryHead'), "ammunitionType", -1);
// phosphorous fire not coded
break;
case "arrowScreamerHead":
SR5_EntityHelpers.updateModifier(itemData.accuracy, game.i18n.localize('SR5.AmmunitionTypeArrowScreamerHead'), "ammunitionType", -2);
armorPenetration = +6;
break;
case "arrowStickNShock":
SR5_EntityHelpers.updateModifier(itemData.accuracy, game.i18n.localize('SR5.AmmunitionTypeArrowStickNShock'), "ammunitionType", -1);
damageValue = 8;
damageType = "stun";
damageElement = "electricity";
armorPenetration = -5;
break;
case "arrowStaticShaft":
damageValue = itemData.ammunition.itemRating + 4;
damageType = "stun";
damageElement = "electricity";
break;
default:
SR5_SystemHelpers.srLog(3, "_handleWeaponAmmunition", `Unknown ammunition type: '${itemData.ammunition.type}'`);
return;
Expand Down
2 changes: 1 addition & 1 deletion scripts/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export const registerHooks = function () {
Hooks.on("createToken", async function(tokenDocument) {
if (!game.user.isGM) return;
let tokenData = duplicate(tokenDocument);
if (tokenDocument.texture.src.includes("systems/sr5/img/actors/")) tokenData.texture.src = tokenDocument.actor.img;
if (tokenData.texture.src == "") tokenData.texture.src = tokenDocument.actor.img;
if (tokenDocument.actor.system.visions?.astral?.isActive) tokenData = await SR5_EntityHelpers.getAstralVisionData(tokenData);
else tokenData = await SR5_EntityHelpers.getBasicVisionData(tokenData);
await tokenDocument.update(tokenData);
Expand Down
2 changes: 1 addition & 1 deletion system.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"flags": {}
}
],
"version": "11.0.12",
"version": "11.0.13",
"compatibility": {
"minimum": "11",
"maximum": "11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
data-helpMessage="{{localize 'SR5.HELP_QuantityMsg'}}">
{{system.quantity}}
</div>
{{#if (or (eq system.type "arrow") (eq system.type "arrowInjection"))}}
{{#if (or (eq system.type "arrow") (eq system.type "arrowInjection") (eq system.type "arrowBarbedHead") (eq system.type "arrowExplosiveHead") (eq system.type "arrowHammerhead") (eq system.type "arrowIncendiaryHead") (eq system.type "arrowScreamerHead") (eq system.type "arrowStickNShock") (eq system.type "arrowStaticShaft"))}}
<div class="col-1 SR-TextCenter changeValueByClick" data-binding="system.itemRating"
data-helpTitle="{{localize 'SR5.HELP_Rating' key=name}}"
data-helpMessage="{{localize 'SR5.HELP_RatingMsg'}}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{{/each}}
{{/select}}
</select>
{{else if (or (eq system.type "arrow") (eq system.type "arrowInjection"))}}
{{else if (or (eq system.type "arrow") (eq system.type "arrowInjection") (eq system.type "arrowBarbedHead") (eq system.type "arrowExplosiveHead") (eq system.type "arrowHammerhead") (eq system.type "arrowIncendiaryHead") (eq system.type "arrowScreamerHead") (eq system.type "arrowStickNShock") (eq system.type "arrowStaticShaft"))}}
<select name="system.class" data-dtype="String" required>
{{#select system.class}}
<option class="SR-LightGreyColor" value="">{{localize 'SR5.ChooseOne'}}</option>
Expand Down
Loading

0 comments on commit e7cac60

Please sign in to comment.