diff --git a/fr.json b/fr.json index 41953ed..d993a56 100644 --- a/fr.json +++ b/fr.json @@ -365,7 +365,9 @@ "ITEM.Maximum":"Maximum", "ITEM.RandomVortex":"Vortex aléatoire", "ITEM.Ritual":"Rituel", - + "ITEM.Standard":"Standard", + "ITEM.TestSkill":"Test de compétence", + "BleedCrit":"L'hémorrage de {name} coagule un peu : 1 Hémorragie peut-être retirée.", "BleedFail":"{name} meur de sa perte de sang !", "BleedRoll":"Jet d'Hémmoragie", @@ -839,7 +841,10 @@ "CHARGEN.Trappings.Remove":"Supprimer", "CHARGEN.Career.LoadingCareers":"Chargement des carrières...", "CHARGEN.Message.RerolledDuplicateTalent":"

Relance du Talent dupliqué: {rolled}!

", - + "CHARGEN.Message.ReplacedTalent":"

Remplacement de {talent} par {replacement}!

", + "CHARGEN.SkillsTalents.ReplaceTalentDialog.Content":"

Voulez vous remplacer {talent} avec {replacement}?

", + "CHARGEN.SkillsTalents.ReplaceTalentDialog.Title":"Remplacer un Talent", + "CAREER.DifferentClass": "Entrée dans une nouvelle Classe", "CAREER.LeaveIncomplete": "Départ d'une carrière incomplète", "CAREER.LeaveComplete": "Départ d'une carrière complétée", @@ -920,6 +925,8 @@ "DIALOG.MemorizeSpell":"Mémoriser un Sort", "DIALOG.MemorizeSpellContent":"Mémoriser ce sort vous coutera {xp} XP.", "DIALOG.ErrorMustSelectItem":"Au moins 1 item doit être selectionné", + "DIALOG.ChooseActor":"Choisissez l'Acteur pour réaliser le test", + "DIALOG.ItemDialog":"Fenêtre d'Item", "CHAT.CareerChoose" : "Choisissez votre carrière", "CHAT.DamageError" : "Erreur de calcul des dégâts:", @@ -1073,7 +1080,16 @@ "CHAT.ApplyHack":"Appliquer Hack", "CHAT.ModifiersBreakdown":"Liste des modificateurs", "CHAT.Place":"Placer", - + "CHAT.AttackerTooSmallDamage":"Attacker is too small to damage this vehicle", + "CHAT.CrewTest":"Test d'équipage", + "CHAT.CrewTestVital":"Test d'équipage (Vital)", + "CHAT.NoCrewWithRole":"Aucun role d'équipage!", + "CHAT.RoleNotFound":"Le role {role} n'a pas été trouvé!", + "CHAT.TotalSL":"DR Totaux", + "CHAT.VehicleTBTooltipMultiply":"{number} × BE", + "CHAT.VehicleTBTooltipSubtract":"BE - {number}", + "CHAT.Vital":"Vital", + "Error.SpeciesSkills" : "Impossible d'ajouter des compétences pour les races", "Error.SpeciesTalents" : "Impossible d'ajouter des talents pour les races", "Error.CriticalWound" : "Erreur lors de l'application des blessures", @@ -1112,6 +1128,10 @@ "ERROR.PrayerAoEOvercast":"La zone d'effet des Prières ne peut être augemntée", "ERROR.AMMO_MODS":"La munition '{type}' ne peut pas être trouvée. Consultez la console (F12) pour les détails`", "ERROR.CannotUseArm":"Bras non utilisable!", + "ERROR.NoAvailableActors":"Aucun acteur disponible pour le choix!", + "ERROR.NoOwnedCrew":"Vous ne contrôlez aucun membre d'équipage qui possède ce rôle", + "ERROR.StandardTraitsOnVehicle":"Impossible d'ajouter des Trais standards à un Véhicule", + "ERROR.VehicleTraitsOnStandard":"Impossible d'ajouter des Traits de Véhicule à un Acteur", "WARNING.Target":"Sélectionnez une cible pour appliquer l'effet.", "WARNING.ActorTest":"Les classes de jet d'acteur ne sont plus utilisées. Appelez désormais `roll()` sur l'objet lui-même.", @@ -1735,6 +1755,7 @@ "NAME.Trade":"Métier", "NAME.Arcane":"Arcane", "NAME.Lingering":"Persistant", + "NAME.FearExtendedTest":"Test étendu de Peur", "SPEC.Tiny" : "Minuscule", "SPEC.Little" : "Très petite", @@ -1852,6 +1873,7 @@ "SHEET.Target":"Cible", "SHEET.ToggleTraits":"Basculer le(s) Trait(s) de Creature", "SHEET.SortItems":"Trier les items", + "SHEET.CannotDeleteCrewEffect":"Cet effet provient d'un véhicule dont cet acteur est membre d'équipage, et doit donc être effacé depuis le véhicule.", "DISEASE.IncubationFinished" : "Incubation de la maladie {disease} terminée. ", @@ -2060,6 +2082,24 @@ "VEHICLE.NoActorOnBoard": "Le personnage qui vous est assigné n'est pas dans le véhicule", "VEHICLE.TestNotPermitted": "Vous n'avez pas la permission de réaliser ce test", "VEHICLE.ft":"ft", + "VEHICLE.CollisionRating":"Mesure de Collision", + "VEHICLE.Crew":"Equipage", + "VEHICLE.CrewTests":"Tests d'équipage", + "VEHICLE.Custom":"Custom", + "VEHICLE.Enabled":"Activé", + "VEHICLE.Man":"Man.", + "VEHICLE.ManannsMood":"Manann's Mood", + "VEHICLE.Morale":"Moral", + "VEHICLE.MoraleEffects":"Effet du moral", + "VEHICLE.Oars":"Rames", + "VEHICLE.PrimaryMode":"Mode primaire", + "VEHICLE.Sail":"Voile", + "VEHICLE.SetValue":"Valeur", + "VEHICLE.SetValueToolTip":"Positionner une valeur particulière au lieu de lancer.", + "VEHICLE.Sources":"Moral", + "VEHICLE.Starting":"Démarre", + "VEHICLE.Type":"Type de véhicule", + "VEHICLE.WeekLabel":"Label de Semaine", "CONFIGURE.CalcTokenSize" : "Calculer automatiquement la taille des Tokens", "CONFIGURE.CalcRun" : "Calculer automatiquement la vitesse de course", @@ -2195,6 +2235,11 @@ "TRADE.Excellent": "Excellente", "TRADE.Topshelf": "Suprême", "TRADE.NoCargoFound":"Il n'y a pas de cargaison disponible à l'achat à {town}.", + "TRADE.Demand":"Demande", + "TRADE.Maritime":"Maritime", + "TRADE.MerchantTest":"Test de Marchand: {SL} DR (Résultat {roll})", + "TRADE.River":"Rivière", + "TRADE.Surplus":"Surplus", "RANDOMIZER.C":"Ca", "RANDOMIZER.S":"C", @@ -2267,6 +2312,9 @@ "ROLL.HitAnotherEngagedTarget":"Oops! Vous avez touche la mauvaise cible, sélectionnez aléatoirement un personnage et appliquez lui les dommages ", "Rounds":"rounds", "SHEET.NoCareers":"Aucune carrière trouvée", + "EFFECT.ShooterEngagedError":"Vous ne pouvez réaliser d'attaque à étant engagé, à moins que vous ne sooyez équipé d'une arme avec la qualité Pistolet", + "EffectApplication.RadiusHint":"Rayon du template (Note: si cet effet provient d'un sort, c'est son diamètre actuel)", + "EffectApplication.Type.Crew":"Equipage", "CHARGEN.AdditionalRandomTalent":"Talent aléatoire additionnel", "CHARGEN.Message.RerolledDuplicate":"

Relance de Talent dupliqué: {rolled}!

", @@ -2342,7 +2390,9 @@ "TYPES.Item.trapping":"Possession", "TYPES.Item.vehicleMod":"Modification de Véhicule", "TYPES.Item.weapon":"Arme", - + "TYPES.Item.vehicleRole":"Role de Véhicule", + "TYPES.Item.vehicleTest":"Test d'équipage de véhicule", + "Badger": "Blaireau", "Badgers": "Blaireaux", "Choose one": "A choisir", @@ -2425,5 +2475,24 @@ "Touch": "Toucher", "SOCKET.SendingSocketRequest":"Envoi d'une requête par Socket", - "UpdaterTitle":"Mise à jour du contenu {title}" + "UpdaterTitle":"Mise à jour du contenu {title}", + + "BREAKADOWN.UserEntry":"Saisie utilisateur", + "BEAKDOWN.UserEntry":"Saisie utilisateur", + "BREAKDOWN.AttackerBase":"Base Attaquant", + "BREAKDOWN.Base":"Base", + "BREAKDOWN.Dice":"Dé", + "BREAKDOWN.Ignored":"Ignoré", + "BREAKDOWN.Minimum1":"1 Blessure minimum", + "BREAKDOWN.Moo":"Règles maison de MooMan", + "BREAKDOWN.Multiplier":"Multiplieur", + "BREAKDOWN.OpposedSL":"DR Opposé", + "BREAKDOWN.Partial":"Partiel - Ignore {ignored} ({item})", + "BREAKDOWN.Penetrating":"Pénétrant - Ignore {ignored} ({item})", + "BREAKDOWN.PenetratingMoo":"Pénétrant - Ignore {ignored}", + "BREAKDOWN.ShieldMoo":"Défense échouée - Ignore Shield AP ({ignored})", + "BREAKDOWN.Undamaging":"Inoffensive: {originalAP} AP * 2 = {modifiedAP}", + "BREAKDOWN.Weakpoints":"Points faibles - Ignore {ignored} ({item})", + "BREAKDOWN.Zzap":"Zzap! - Ignore {ignored}" + } diff --git a/modules/babele-register.js b/modules/babele-register.js index d27ea08..4cffe8f 100644 --- a/modules/babele-register.js +++ b/modules/babele-register.js @@ -218,15 +218,15 @@ Hooks.once('init', () => { /*---------------------------------------------------------------------*/ // Converters area - if (typeof Babele !== 'undefined') { + if (game.babele !== 'undefined') { - Babele.get().register({ + game.babele.register({ module: 'wh4-fr-translation', lang: 'fr', dir: 'compendium' }) - Babele.get().registerConverters({ + game.babele.registerConverters({ "career_skills": (skills_list) => { let validCompendiums = game.wfrp4e.tags.getPacksWithTag("skill") @@ -294,13 +294,13 @@ Hooks.once('init', () => { let career = data.text.match(/{(.*)}/) //console.log(">>>>>", career) if (career && career[1]) { - let careerFR = Babele.instance.converters.career_careergroup(career[1]) + let careerFR = game.babele.converters.career_careergroup(career[1]) data.text = data.text.replace(career[1], careerFR) } } } if (results[0].documentCollection) { - return Babele.instance.converters.tableResults(results) + return game.babele.instance.converters.tableResults(results) } return results }, diff --git a/packs/aides-de-jeu-fr/000748.log b/packs/aides-de-jeu-fr/000757.log similarity index 100% rename from packs/aides-de-jeu-fr/000748.log rename to packs/aides-de-jeu-fr/000757.log diff --git a/packs/aides-de-jeu-fr/CURRENT b/packs/aides-de-jeu-fr/CURRENT index 6d50c3b..9d62470 100644 --- a/packs/aides-de-jeu-fr/CURRENT +++ b/packs/aides-de-jeu-fr/CURRENT @@ -1 +1 @@ -MANIFEST-000746 +MANIFEST-000756 diff --git a/packs/aides-de-jeu-fr/LOG b/packs/aides-de-jeu-fr/LOG index 360a5ea..b02330f 100644 --- a/packs/aides-de-jeu-fr/LOG +++ b/packs/aides-de-jeu-fr/LOG @@ -1,7 +1,3 @@ -2024/05/31-09:37:32.376772 7f19c7e006c0 Recovering log #744 -2024/05/31-09:37:32.432762 7f19c7e006c0 Delete type=3 #742 -2024/05/31-09:37:32.432815 7f19c7e006c0 Delete type=0 #744 -2024/05/31-10:40:01.792285 7f19c56006c0 Level-0 table #749: started -2024/05/31-10:40:01.792317 7f19c56006c0 Level-0 table #749: 0 bytes OK -2024/05/31-10:40:01.798878 7f19c56006c0 Delete type=0 #747 -2024/05/31-10:40:01.811597 7f19c56006c0 Manual compaction at level-0 from '!journal!3IgmiprzLB6Lwenc' @ 72057594037927935 : 1 .. '!journal.pages!suuYN87Al1ZZWtQQ.jhgNnhWhrkOpKs1B' @ 0 : 0; will stop at (end) +2024/06/06-20:54:36.421316 7fcfb2a006c0 Recovering log #754 +2024/06/06-20:54:36.431498 7fcfb2a006c0 Delete type=3 #752 +2024/06/06-20:54:36.431579 7fcfb2a006c0 Delete type=0 #754 diff --git a/packs/aides-de-jeu-fr/LOG.old b/packs/aides-de-jeu-fr/LOG.old index 72c813c..1209c1a 100644 --- a/packs/aides-de-jeu-fr/LOG.old +++ b/packs/aides-de-jeu-fr/LOG.old @@ -1,7 +1,7 @@ -2024/05/29-22:15:26.921445 7f5b0b8006c0 Recovering log #739 -2024/05/29-22:15:26.945868 7f5b0b8006c0 Delete type=3 #737 -2024/05/29-22:15:26.945925 7f5b0b8006c0 Delete type=0 #739 -2024/05/29-22:42:08.086719 7f5b0a8006c0 Level-0 table #745: started -2024/05/29-22:42:08.086744 7f5b0a8006c0 Level-0 table #745: 0 bytes OK -2024/05/29-22:42:08.093895 7f5b0a8006c0 Delete type=0 #743 -2024/05/29-22:42:08.114027 7f5b0a8006c0 Manual compaction at level-0 from '!journal!3IgmiprzLB6Lwenc' @ 72057594037927935 : 1 .. '!journal.pages!suuYN87Al1ZZWtQQ.jhgNnhWhrkOpKs1B' @ 0 : 0; will stop at (end) +2024/06/01-20:41:11.767917 7f47516006c0 Recovering log #751 +2024/06/01-20:41:11.778523 7f47516006c0 Delete type=0 #751 +2024/06/01-20:41:11.778570 7f47516006c0 Delete type=3 #750 +2024/06/01-20:41:56.329216 7f474f8006c0 Level-0 table #755: started +2024/06/01-20:41:56.329241 7f474f8006c0 Level-0 table #755: 0 bytes OK +2024/06/01-20:41:56.335388 7f474f8006c0 Delete type=0 #753 +2024/06/01-20:41:56.348176 7f474f8006c0 Manual compaction at level-0 from '!journal!3IgmiprzLB6Lwenc' @ 72057594037927935 : 1 .. '!journal.pages!suuYN87Al1ZZWtQQ.jhgNnhWhrkOpKs1B' @ 0 : 0; will stop at (end) diff --git a/packs/aides-de-jeu-fr/MANIFEST-000746 b/packs/aides-de-jeu-fr/MANIFEST-000756 similarity index 84% rename from packs/aides-de-jeu-fr/MANIFEST-000746 rename to packs/aides-de-jeu-fr/MANIFEST-000756 index 6cb7cb5..145fbed 100644 Binary files a/packs/aides-de-jeu-fr/MANIFEST-000746 and b/packs/aides-de-jeu-fr/MANIFEST-000756 differ diff --git a/packs/antidotes-and-remedes/000750.log b/packs/antidotes-and-remedes/000759.log similarity index 100% rename from packs/antidotes-and-remedes/000750.log rename to packs/antidotes-and-remedes/000759.log diff --git a/packs/antidotes-and-remedes/CURRENT b/packs/antidotes-and-remedes/CURRENT index 8009070..0ce01d9 100644 --- a/packs/antidotes-and-remedes/CURRENT +++ b/packs/antidotes-and-remedes/CURRENT @@ -1 +1 @@ -MANIFEST-000748 +MANIFEST-000758 diff --git a/packs/antidotes-and-remedes/LOG b/packs/antidotes-and-remedes/LOG index bccf299..f7521a7 100644 --- a/packs/antidotes-and-remedes/LOG +++ b/packs/antidotes-and-remedes/LOG @@ -1,7 +1,3 @@ -2024/05/31-09:37:32.440532 7f19c60006c0 Recovering log #746 -2024/05/31-09:37:32.493255 7f19c60006c0 Delete type=3 #744 -2024/05/31-09:37:32.493359 7f19c60006c0 Delete type=0 #746 -2024/05/31-10:40:01.811747 7f19c56006c0 Level-0 table #751: started -2024/05/31-10:40:01.811783 7f19c56006c0 Level-0 table #751: 0 bytes OK -2024/05/31-10:40:01.817818 7f19c56006c0 Delete type=0 #749 -2024/05/31-10:40:01.818008 7f19c56006c0 Manual compaction at level-0 from '!folders!3uquYH73ttCdoH0I' @ 72057594037927935 : 1 .. '!items!ylFhk7mGZOnAJTUT' @ 0 : 0; will stop at (end) +2024/06/06-20:54:36.435801 7fcfb34006c0 Recovering log #756 +2024/06/06-20:54:36.446523 7fcfb34006c0 Delete type=3 #754 +2024/06/06-20:54:36.446619 7fcfb34006c0 Delete type=0 #756 diff --git a/packs/antidotes-and-remedes/LOG.old b/packs/antidotes-and-remedes/LOG.old index 32cda32..f1a0ff5 100644 --- a/packs/antidotes-and-remedes/LOG.old +++ b/packs/antidotes-and-remedes/LOG.old @@ -1,7 +1,7 @@ -2024/05/29-22:15:26.951019 7f5b0d6006c0 Recovering log #741 -2024/05/29-22:15:26.961978 7f5b0d6006c0 Delete type=3 #739 -2024/05/29-22:15:26.962039 7f5b0d6006c0 Delete type=0 #741 -2024/05/29-22:42:08.094093 7f5b0a8006c0 Level-0 table #747: started -2024/05/29-22:42:08.094135 7f5b0a8006c0 Level-0 table #747: 0 bytes OK -2024/05/29-22:42:08.100255 7f5b0a8006c0 Delete type=0 #745 -2024/05/29-22:42:08.114040 7f5b0a8006c0 Manual compaction at level-0 from '!folders!3uquYH73ttCdoH0I' @ 72057594037927935 : 1 .. '!items!ylFhk7mGZOnAJTUT' @ 0 : 0; will stop at (end) +2024/06/01-20:41:11.781332 7f47520006c0 Recovering log #753 +2024/06/01-20:41:11.791330 7f47520006c0 Delete type=0 #753 +2024/06/01-20:41:11.791383 7f47520006c0 Delete type=3 #752 +2024/06/01-20:41:56.335472 7f474f8006c0 Level-0 table #757: started +2024/06/01-20:41:56.335492 7f474f8006c0 Level-0 table #757: 0 bytes OK +2024/06/01-20:41:56.341778 7f474f8006c0 Delete type=0 #755 +2024/06/01-20:41:56.348186 7f474f8006c0 Manual compaction at level-0 from '!folders!3uquYH73ttCdoH0I' @ 72057594037927935 : 1 .. '!items!ylFhk7mGZOnAJTUT' @ 0 : 0; will stop at (end) diff --git a/packs/antidotes-and-remedes/MANIFEST-000748 b/packs/antidotes-and-remedes/MANIFEST-000758 similarity index 71% rename from packs/antidotes-and-remedes/MANIFEST-000748 rename to packs/antidotes-and-remedes/MANIFEST-000758 index debd4a8..5269475 100644 Binary files a/packs/antidotes-and-remedes/MANIFEST-000748 and b/packs/antidotes-and-remedes/MANIFEST-000758 differ diff --git a/packs/apothicarium/000748.log b/packs/apothicarium/000757.log similarity index 100% rename from packs/apothicarium/000748.log rename to packs/apothicarium/000757.log diff --git a/packs/apothicarium/CURRENT b/packs/apothicarium/CURRENT index 6d50c3b..9d62470 100644 --- a/packs/apothicarium/CURRENT +++ b/packs/apothicarium/CURRENT @@ -1 +1 @@ -MANIFEST-000746 +MANIFEST-000756 diff --git a/packs/apothicarium/LOG b/packs/apothicarium/LOG index 2347b27..b1c6679 100644 --- a/packs/apothicarium/LOG +++ b/packs/apothicarium/LOG @@ -1,7 +1,3 @@ -2024/05/31-09:37:32.579979 7f19c60006c0 Recovering log #744 -2024/05/31-09:37:32.634808 7f19c60006c0 Delete type=3 #742 -2024/05/31-09:37:32.634871 7f19c60006c0 Delete type=0 #744 -2024/05/31-10:40:01.798996 7f19c56006c0 Level-0 table #749: started -2024/05/31-10:40:01.799024 7f19c56006c0 Level-0 table #749: 0 bytes OK -2024/05/31-10:40:01.805113 7f19c56006c0 Delete type=0 #747 -2024/05/31-10:40:01.811607 7f19c56006c0 Manual compaction at level-0 from '!journal!cZtNgayIw2QFhC9u' @ 72057594037927935 : 1 .. '!journal.pages!cZtNgayIw2QFhC9u.ts265H1XkisLgdow' @ 0 : 0; will stop at (end) +2024/06/06-20:54:36.466388 7fcfb34006c0 Recovering log #754 +2024/06/06-20:54:36.476745 7fcfb34006c0 Delete type=3 #752 +2024/06/06-20:54:36.476826 7fcfb34006c0 Delete type=0 #754 diff --git a/packs/apothicarium/LOG.old b/packs/apothicarium/LOG.old index a961dad..b8c768b 100644 --- a/packs/apothicarium/LOG.old +++ b/packs/apothicarium/LOG.old @@ -1,7 +1,7 @@ -2024/05/29-22:15:26.981610 7f5b0c2006c0 Recovering log #739 -2024/05/29-22:15:26.991864 7f5b0c2006c0 Delete type=3 #737 -2024/05/29-22:15:26.991966 7f5b0c2006c0 Delete type=0 #739 -2024/05/29-22:42:08.100370 7f5b0a8006c0 Level-0 table #745: started -2024/05/29-22:42:08.100395 7f5b0a8006c0 Level-0 table #745: 0 bytes OK -2024/05/29-22:42:08.107039 7f5b0a8006c0 Delete type=0 #743 -2024/05/29-22:42:08.114048 7f5b0a8006c0 Manual compaction at level-0 from '!journal!cZtNgayIw2QFhC9u' @ 72057594037927935 : 1 .. '!journal.pages!cZtNgayIw2QFhC9u.ts265H1XkisLgdow' @ 0 : 0; will stop at (end) +2024/06/01-20:41:11.810548 7f47502006c0 Recovering log #751 +2024/06/01-20:41:11.865308 7f47502006c0 Delete type=0 #751 +2024/06/01-20:41:11.865356 7f47502006c0 Delete type=3 #750 +2024/06/01-20:41:56.348302 7f474f8006c0 Level-0 table #755: started +2024/06/01-20:41:56.348325 7f474f8006c0 Level-0 table #755: 0 bytes OK +2024/06/01-20:41:56.354398 7f474f8006c0 Delete type=0 #753 +2024/06/01-20:41:56.385741 7f474f8006c0 Manual compaction at level-0 from '!journal!cZtNgayIw2QFhC9u' @ 72057594037927935 : 1 .. '!journal.pages!cZtNgayIw2QFhC9u.ts265H1XkisLgdow' @ 0 : 0; will stop at (end) diff --git a/packs/apothicarium/MANIFEST-000746 b/packs/apothicarium/MANIFEST-000756 similarity index 84% rename from packs/apothicarium/MANIFEST-000746 rename to packs/apothicarium/MANIFEST-000756 index bf16893..52ddd5e 100644 Binary files a/packs/apothicarium/MANIFEST-000746 and b/packs/apothicarium/MANIFEST-000756 differ diff --git a/packs/dons-de-rhya/000748.log b/packs/dons-de-rhya/000757.log similarity index 100% rename from packs/dons-de-rhya/000748.log rename to packs/dons-de-rhya/000757.log diff --git a/packs/dons-de-rhya/CURRENT b/packs/dons-de-rhya/CURRENT index 6d50c3b..9d62470 100644 --- a/packs/dons-de-rhya/CURRENT +++ b/packs/dons-de-rhya/CURRENT @@ -1 +1 @@ -MANIFEST-000746 +MANIFEST-000756 diff --git a/packs/dons-de-rhya/LOG b/packs/dons-de-rhya/LOG index 6cf7f75..b1b0d38 100644 --- a/packs/dons-de-rhya/LOG +++ b/packs/dons-de-rhya/LOG @@ -1,7 +1,3 @@ -2024/05/31-09:37:32.306200 7f19c60006c0 Recovering log #744 -2024/05/31-09:37:32.365977 7f19c60006c0 Delete type=3 #742 -2024/05/31-09:37:32.366032 7f19c60006c0 Delete type=0 #744 -2024/05/31-10:40:01.779134 7f19c56006c0 Level-0 table #749: started -2024/05/31-10:40:01.779173 7f19c56006c0 Level-0 table #749: 0 bytes OK -2024/05/31-10:40:01.785789 7f19c56006c0 Delete type=0 #747 -2024/05/31-10:40:01.785917 7f19c56006c0 Manual compaction at level-0 from '!journal!50u8VAjdmovyr0hx' @ 72057594037927935 : 1 .. '!journal.pages!yzw9I0r3hCK7PJnz.sPNCYj2nR3Cp3jHd' @ 0 : 0; will stop at (end) +2024/06/06-20:54:36.406301 7fcfb34006c0 Recovering log #754 +2024/06/06-20:54:36.416875 7fcfb34006c0 Delete type=3 #752 +2024/06/06-20:54:36.416980 7fcfb34006c0 Delete type=0 #754 diff --git a/packs/dons-de-rhya/LOG.old b/packs/dons-de-rhya/LOG.old index 6fc0ea3..60d7d73 100644 --- a/packs/dons-de-rhya/LOG.old +++ b/packs/dons-de-rhya/LOG.old @@ -1,7 +1,7 @@ -2024/05/29-22:15:26.903601 7f5b0c2006c0 Recovering log #739 -2024/05/29-22:15:26.917559 7f5b0c2006c0 Delete type=3 #737 -2024/05/29-22:15:26.917932 7f5b0c2006c0 Delete type=0 #739 -2024/05/29-22:42:08.040267 7f5b0a8006c0 Level-0 table #745: started -2024/05/29-22:42:08.040295 7f5b0a8006c0 Level-0 table #745: 0 bytes OK -2024/05/29-22:42:08.068788 7f5b0a8006c0 Delete type=0 #743 -2024/05/29-22:42:08.086595 7f5b0a8006c0 Manual compaction at level-0 from '!journal!50u8VAjdmovyr0hx' @ 72057594037927935 : 1 .. '!journal.pages!yzw9I0r3hCK7PJnz.sPNCYj2nR3Cp3jHd' @ 0 : 0; will stop at (end) +2024/06/01-20:41:11.755391 7f47502006c0 Recovering log #751 +2024/06/01-20:41:11.764693 7f47502006c0 Delete type=0 #751 +2024/06/01-20:41:11.764768 7f47502006c0 Delete type=3 #750 +2024/06/01-20:41:56.312298 7f474f8006c0 Level-0 table #755: started +2024/06/01-20:41:56.312320 7f474f8006c0 Level-0 table #755: 0 bytes OK +2024/06/01-20:41:56.318409 7f474f8006c0 Delete type=0 #753 +2024/06/01-20:41:56.318543 7f474f8006c0 Manual compaction at level-0 from '!journal!50u8VAjdmovyr0hx' @ 72057594037927935 : 1 .. '!journal.pages!yzw9I0r3hCK7PJnz.sPNCYj2nR3Cp3jHd' @ 0 : 0; will stop at (end) diff --git a/packs/dons-de-rhya/MANIFEST-000746 b/packs/dons-de-rhya/MANIFEST-000756 similarity index 84% rename from packs/dons-de-rhya/MANIFEST-000746 rename to packs/dons-de-rhya/MANIFEST-000756 index 670f7cf..e8638cc 100644 Binary files a/packs/dons-de-rhya/MANIFEST-000746 and b/packs/dons-de-rhya/MANIFEST-000756 differ diff --git a/packs/plats-dauberges/000748.log b/packs/plats-dauberges/000757.log similarity index 100% rename from packs/plats-dauberges/000748.log rename to packs/plats-dauberges/000757.log diff --git a/packs/plats-dauberges/CURRENT b/packs/plats-dauberges/CURRENT index 6d50c3b..9d62470 100644 --- a/packs/plats-dauberges/CURRENT +++ b/packs/plats-dauberges/CURRENT @@ -1 +1 @@ -MANIFEST-000746 +MANIFEST-000756 diff --git a/packs/plats-dauberges/LOG b/packs/plats-dauberges/LOG index 8db030c..46baf52 100644 --- a/packs/plats-dauberges/LOG +++ b/packs/plats-dauberges/LOG @@ -1,7 +1,3 @@ -2024/05/31-09:37:32.229735 7f19c7e006c0 Recovering log #744 -2024/05/31-09:37:32.290900 7f19c7e006c0 Delete type=3 #742 -2024/05/31-09:37:32.290955 7f19c7e006c0 Delete type=0 #744 -2024/05/31-10:40:01.745865 7f19c56006c0 Level-0 table #749: started -2024/05/31-10:40:01.745898 7f19c56006c0 Level-0 table #749: 0 bytes OK -2024/05/31-10:40:01.752538 7f19c56006c0 Delete type=0 #747 -2024/05/31-10:40:01.759248 7f19c56006c0 Manual compaction at level-0 from '!tables!4l60Lxv8cpsyy2Cg' @ 72057594037927935 : 1 .. '!tables.results!tfaYKDZqu7kgZvRG.yvbwKursaixh2dby' @ 0 : 0; will stop at (end) +2024/06/06-20:54:36.390344 7fcfb2a006c0 Recovering log #754 +2024/06/06-20:54:36.401236 7fcfb2a006c0 Delete type=3 #752 +2024/06/06-20:54:36.401373 7fcfb2a006c0 Delete type=0 #754 diff --git a/packs/plats-dauberges/LOG.old b/packs/plats-dauberges/LOG.old index 7002622..763c1be 100644 --- a/packs/plats-dauberges/LOG.old +++ b/packs/plats-dauberges/LOG.old @@ -1,7 +1,7 @@ -2024/05/29-22:15:26.888481 7f5b0cc006c0 Recovering log #739 -2024/05/29-22:15:26.899481 7f5b0cc006c0 Delete type=3 #737 -2024/05/29-22:15:26.899538 7f5b0cc006c0 Delete type=0 #739 -2024/05/29-22:42:08.080368 7f5b0a8006c0 Level-0 table #745: started -2024/05/29-22:42:08.080405 7f5b0a8006c0 Level-0 table #745: 0 bytes OK -2024/05/29-22:42:08.086437 7f5b0a8006c0 Delete type=0 #743 -2024/05/29-22:42:08.086618 7f5b0a8006c0 Manual compaction at level-0 from '!tables!4l60Lxv8cpsyy2Cg' @ 72057594037927935 : 1 .. '!tables.results!tfaYKDZqu7kgZvRG.yvbwKursaixh2dby' @ 0 : 0; will stop at (end) +2024/06/01-20:41:11.741198 7f4750c006c0 Recovering log #751 +2024/06/01-20:41:11.752851 7f4750c006c0 Delete type=0 #751 +2024/06/01-20:41:11.752903 7f4750c006c0 Delete type=3 #750 +2024/06/01-20:41:56.304431 7f474f8006c0 Level-0 table #755: started +2024/06/01-20:41:56.304456 7f474f8006c0 Level-0 table #755: 0 bytes OK +2024/06/01-20:41:56.312191 7f474f8006c0 Delete type=0 #753 +2024/06/01-20:41:56.318536 7f474f8006c0 Manual compaction at level-0 from '!tables!4l60Lxv8cpsyy2Cg' @ 72057594037927935 : 1 .. '!tables.results!tfaYKDZqu7kgZvRG.yvbwKursaixh2dby' @ 0 : 0; will stop at (end) diff --git a/packs/plats-dauberges/MANIFEST-000746 b/packs/plats-dauberges/MANIFEST-000756 similarity index 83% rename from packs/plats-dauberges/MANIFEST-000746 rename to packs/plats-dauberges/MANIFEST-000756 index a0e124a..e6aadd8 100644 Binary files a/packs/plats-dauberges/MANIFEST-000746 and b/packs/plats-dauberges/MANIFEST-000756 differ diff --git a/packs/tables-des-traductions/000391.log b/packs/tables-des-traductions/000400.log similarity index 100% rename from packs/tables-des-traductions/000391.log rename to packs/tables-des-traductions/000400.log diff --git a/packs/tables-des-traductions/CURRENT b/packs/tables-des-traductions/CURRENT index 3016018..34e89f8 100644 --- a/packs/tables-des-traductions/CURRENT +++ b/packs/tables-des-traductions/CURRENT @@ -1 +1 @@ -MANIFEST-000389 +MANIFEST-000399 diff --git a/packs/tables-des-traductions/LOG b/packs/tables-des-traductions/LOG index 4d21abc..b84d42b 100644 --- a/packs/tables-des-traductions/LOG +++ b/packs/tables-des-traductions/LOG @@ -1,8 +1,3 @@ -2024/05/31-09:37:32.503566 7f19c7e006c0 Recovering log #387 -2024/05/31-09:37:32.572091 7f19c7e006c0 Delete type=3 #385 -2024/05/31-09:37:32.572143 7f19c7e006c0 Delete type=0 #387 -2024/05/31-10:40:01.805216 7f19c56006c0 Level-0 table #392: started -2024/05/31-10:40:01.805249 7f19c56006c0 Level-0 table #392: 0 bytes OK -2024/05/31-10:40:01.811475 7f19c56006c0 Delete type=0 #390 -2024/05/31-10:40:01.811622 7f19c56006c0 Manual compaction at level-0 from '!journal!056ILNNrLiPq3Gi3' @ 72057594037927935 : 1 .. '!journal.pages!yfZxl4I7XAuUF6r3.apXmOlZRmGT4GreB' @ 0 : 0; will stop at (end) -2024/05/31-10:40:01.811643 7f19c56006c0 Manual compaction at level-1 from '!journal!056ILNNrLiPq3Gi3' @ 72057594037927935 : 1 .. '!journal.pages!yfZxl4I7XAuUF6r3.apXmOlZRmGT4GreB' @ 0 : 0; will stop at (end) +2024/06/06-20:54:36.451532 7fcfb2a006c0 Recovering log #397 +2024/06/06-20:54:36.462207 7fcfb2a006c0 Delete type=3 #395 +2024/06/06-20:54:36.462346 7fcfb2a006c0 Delete type=0 #397 diff --git a/packs/tables-des-traductions/LOG.old b/packs/tables-des-traductions/LOG.old index eb1fa25..7d269e5 100644 --- a/packs/tables-des-traductions/LOG.old +++ b/packs/tables-des-traductions/LOG.old @@ -1,8 +1,8 @@ -2024/05/29-22:15:26.967160 7f5b0cc006c0 Recovering log #382 -2024/05/29-22:15:26.977447 7f5b0cc006c0 Delete type=3 #380 -2024/05/29-22:15:26.977504 7f5b0cc006c0 Delete type=0 #382 -2024/05/29-22:42:08.107240 7f5b0a8006c0 Level-0 table #388: started -2024/05/29-22:42:08.107291 7f5b0a8006c0 Level-0 table #388: 0 bytes OK -2024/05/29-22:42:08.113903 7f5b0a8006c0 Delete type=0 #386 -2024/05/29-22:42:08.114056 7f5b0a8006c0 Manual compaction at level-0 from '!journal!056ILNNrLiPq3Gi3' @ 72057594037927935 : 1 .. '!journal.pages!yfZxl4I7XAuUF6r3.apXmOlZRmGT4GreB' @ 0 : 0; will stop at (end) -2024/05/29-22:42:08.114092 7f5b0a8006c0 Manual compaction at level-1 from '!journal!056ILNNrLiPq3Gi3' @ 72057594037927935 : 1 .. '!journal.pages!yfZxl4I7XAuUF6r3.apXmOlZRmGT4GreB' @ 0 : 0; will stop at (end) +2024/06/01-20:41:11.796336 7f4750c006c0 Recovering log #394 +2024/06/01-20:41:11.805903 7f4750c006c0 Delete type=0 #394 +2024/06/01-20:41:11.805963 7f4750c006c0 Delete type=3 #393 +2024/06/01-20:41:56.341877 7f474f8006c0 Level-0 table #398: started +2024/06/01-20:41:56.341900 7f474f8006c0 Level-0 table #398: 0 bytes OK +2024/06/01-20:41:56.348074 7f474f8006c0 Delete type=0 #396 +2024/06/01-20:41:56.348194 7f474f8006c0 Manual compaction at level-0 from '!journal!056ILNNrLiPq3Gi3' @ 72057594037927935 : 1 .. '!journal.pages!yfZxl4I7XAuUF6r3.apXmOlZRmGT4GreB' @ 0 : 0; will stop at (end) +2024/06/01-20:41:56.348213 7f474f8006c0 Manual compaction at level-1 from '!journal!056ILNNrLiPq3Gi3' @ 72057594037927935 : 1 .. '!journal.pages!yfZxl4I7XAuUF6r3.apXmOlZRmGT4GreB' @ 0 : 0; will stop at (end) diff --git a/packs/tables-des-traductions/MANIFEST-000389 b/packs/tables-des-traductions/MANIFEST-000399 similarity index 84% rename from packs/tables-des-traductions/MANIFEST-000389 rename to packs/tables-des-traductions/MANIFEST-000399 index 1e1c8f9..17520ca 100644 Binary files a/packs/tables-des-traductions/MANIFEST-000389 and b/packs/tables-des-traductions/MANIFEST-000399 differ diff --git a/reference_scripts/18MeEQ0As3JvER71.js b/reference_scripts/18MeEQ0As3JvER71.js new file mode 100644 index 0000000..122146a --- /dev/null +++ b/reference_scripts/18MeEQ0As3JvER71.js @@ -0,0 +1,7 @@ +let state = !this.effect.disabled; +this.effect.update({"disabled": state}); + +if (state) + return ui.notifications.info("EFFECT.CreatureBackInWater", {localize: true}) + +return ui.notifications.info("EFFECT.CreatureOutOfWater", {localize: true}); \ No newline at end of file diff --git a/reference_scripts/1LDSzXeO5CzXgTOc.js b/reference_scripts/1LDSzXeO5CzXgTOc.js new file mode 100644 index 0000000..031e1ac --- /dev/null +++ b/reference_scripts/1LDSzXeO5CzXgTOc.js @@ -0,0 +1 @@ +return args.skill?.name.includes(game.i18n.localize("NAME.Channelling")) || args.skill?.name == `${game.i18n.localize("NAME.Language")} (${game.i18n.localize("SPEC.Magick")})` \ No newline at end of file diff --git a/reference_scripts/1jQq9v8fXK8zuEBU.js b/reference_scripts/1jQq9v8fXK8zuEBU.js new file mode 100644 index 0000000..9ac57f6 --- /dev/null +++ b/reference_scripts/1jQq9v8fXK8zuEBU.js @@ -0,0 +1,20 @@ +let damage = this.effect.sourceActor.hasCondition("fatigued") ? 6 : 10; + +let loc = "body" + +let APatLoc = this.actor.system.status.armour[loc]; + +let metalAP = APatLoc.layers.reduce((metal, layer) => metal += ((layer.metal && !layer.magical) ? layer.value : 0), 0) + +let APused = Math.max(0, APatLoc.value - metalAP); // remove metal AP at location; + +damage -= (APused + this.actor.system.characteristics.t.bonus) + +let msg = await this.actor.applyBasicDamage(damage, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL}); +msg += ` (ignored ${metalAP} metal AP on ${game.wfrp4e.config.locations[loc]})` +this.script.scriptMessage(msg) + +let test = await this.actor.setupSkill("Endurance", {fields : {difficulty : "difficult"}, appendTitle : ` - ${this.effect.name}`}); +await test.roll(); +if (test.failed) + this.actor.addCondition("stunned"); \ No newline at end of file diff --git a/reference_scripts/2QB0LjueuJcIaHaC.js b/reference_scripts/2QB0LjueuJcIaHaC.js new file mode 100644 index 0000000..7fd2601 --- /dev/null +++ b/reference_scripts/2QB0LjueuJcIaHaC.js @@ -0,0 +1,8 @@ +if (isNaN(parseInt(this.item.system.specification.value))) +{ + let value = await ValueDialog.create("Enter Armour value", this.effect.name); + if (value) + { + this.item.updateSource({"system.specification.value" : value}); + } +} \ No newline at end of file diff --git a/reference_scripts/2W9uMTT6iJhfQ044.js b/reference_scripts/2W9uMTT6iJhfQ044.js index fb037b9..dd8d817 100644 --- a/reference_scripts/2W9uMTT6iJhfQ044.js +++ b/reference_scripts/2W9uMTT6iJhfQ044.js @@ -6,13 +6,14 @@ if (!currentCareer) return let inCurrentCareer = currentCareer.system.skills.includes(skill); -if (existingSkill && inCurrentCareer) +let craftsmanAdded = this.actor.getFlag("wfrp4e", "craftsmanAdded") || {}; +if (existingSkill && inCurrentCareer && !craftsmanAdded[existingSkill.name]) { existingSkill.system.advances.costModifier = -5; } else { + craftsmanAdded[skill] = true; currentCareer.system.skills.push(skill); -} - - + setProperty(this.actor, "flags.wfrp4e.craftsmanAdded", craftsmanAdded) +} \ No newline at end of file diff --git a/reference_scripts/3CdYFcInQVCIBUiE.js b/reference_scripts/3CdYFcInQVCIBUiE.js new file mode 100644 index 0000000..69af1ae --- /dev/null +++ b/reference_scripts/3CdYFcInQVCIBUiE.js @@ -0,0 +1,3 @@ +args.actor.system.details.move.value += 2; +args.actor.system.status.carries.max = Math.floor(args.actor.system.status.carries.max * 0.5); +args.actor.system.details.price.gc *= 1.1; \ No newline at end of file diff --git a/reference_scripts/3nTSOcCmNZpQWK8b.js b/reference_scripts/3nTSOcCmNZpQWK8b.js new file mode 100644 index 0000000..49dd61a --- /dev/null +++ b/reference_scripts/3nTSOcCmNZpQWK8b.js @@ -0,0 +1 @@ +this.actor.addCondition("blinded", 3); \ No newline at end of file diff --git a/reference_scripts/4cumLUlcuJ7m8C6t.js b/reference_scripts/4cumLUlcuJ7m8C6t.js new file mode 100644 index 0000000..ce8df65 --- /dev/null +++ b/reference_scripts/4cumLUlcuJ7m8C6t.js @@ -0,0 +1,4 @@ +let item = args.actor.items.find(i => i.name.includes("Smoothing")); +let smoothing = item?.effects.find(e => e.name === "Smoothing"); +if (smoothing) + smoothing.disabled = true; \ No newline at end of file diff --git a/reference_scripts/4drWKXjMgasxY7Jy.js b/reference_scripts/4drWKXjMgasxY7Jy.js new file mode 100644 index 0000000..313f7b5 --- /dev/null +++ b/reference_scripts/4drWKXjMgasxY7Jy.js @@ -0,0 +1 @@ +args.actor.system.details.price.gc += Math.floor(args.actor.system.details.price.gc * 0.1); \ No newline at end of file diff --git a/reference_scripts/4otpLq2TnDdgzpvc.js b/reference_scripts/4otpLq2TnDdgzpvc.js new file mode 100644 index 0000000..ce5c7f0 --- /dev/null +++ b/reference_scripts/4otpLq2TnDdgzpvc.js @@ -0,0 +1 @@ +args.actor.system.details.man -= 3; \ No newline at end of file diff --git a/reference_scripts/4uAUUZmLgxBKSmXA.js b/reference_scripts/4uAUUZmLgxBKSmXA.js new file mode 100644 index 0000000..42f8c77 --- /dev/null +++ b/reference_scripts/4uAUUZmLgxBKSmXA.js @@ -0,0 +1,2 @@ +if (args.totalWoundLoss > 0) + this.effect.delete(); \ No newline at end of file diff --git a/reference_scripts/5ScjIdRUOxblHdWS.js b/reference_scripts/5ScjIdRUOxblHdWS.js new file mode 100644 index 0000000..351ac87 --- /dev/null +++ b/reference_scripts/5ScjIdRUOxblHdWS.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Carpenter)'; +const difficulty = 'challenging'; +const target = 40; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/5sYpJkT2WXIe0gIZ.js b/reference_scripts/5sYpJkT2WXIe0gIZ.js new file mode 100644 index 0000000..c5b5bc6 --- /dev/null +++ b/reference_scripts/5sYpJkT2WXIe0gIZ.js @@ -0,0 +1,19 @@ +const rating = parseInt(this.effect.name.match(/\d+/)?.[0]) || 1; + +let crewList = foundry.utils.duplicate(this.actor.system.passengers.list); +let selectedCrew = []; + +while (selectedCrew.length < rating && crewList.length) { + selectedCrew.push(crewList.splice(crewList.length * Math.random() | 0, 1)[0]); +} + +for (let member of selectedCrew) { + let actor = game.actors.get(member.id); + actor.applyBasicDamage(9, { + damageType: game.wfrp4e.config.DAMAGE_TYPE.NORMAL, + minimumOne: true, + loc: "roll", + suppressMsg: false, + hideDSN: false + }); +} \ No newline at end of file diff --git a/reference_scripts/6Ws3ieQ7pG5poUyT.js b/reference_scripts/6Ws3ieQ7pG5poUyT.js new file mode 100644 index 0000000..b9ff46a --- /dev/null +++ b/reference_scripts/6Ws3ieQ7pG5poUyT.js @@ -0,0 +1,8 @@ +if (isNaN(parseInt(this.item.system.specification.value))) +{ + let value = await ValueDialog.create("Enter Spellcasting Lore", this.effect.name, "", Object.values(game.wfrp4e.config.magicLores)); + if (value) + { + this.item.updateSource({"system.specification.value" : value}); + } +} \ No newline at end of file diff --git a/reference_scripts/6gRixT3zIOAberJb.js b/reference_scripts/6gRixT3zIOAberJb.js new file mode 100644 index 0000000..09172e0 --- /dev/null +++ b/reference_scripts/6gRixT3zIOAberJb.js @@ -0,0 +1,5 @@ +const disease = await fromUuid("Compendium.wfrp4e-soc.items.Item.8Q9JYtR1y3B5J6UH"); +const data = disease.toObject(); +data.system.incubation.value = 0; +data.system.duration.active = true; +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id}); \ No newline at end of file diff --git a/reference_scripts/6jp8slPU33oBQe1V.js b/reference_scripts/6jp8slPU33oBQe1V.js new file mode 100644 index 0000000..e38825c --- /dev/null +++ b/reference_scripts/6jp8slPU33oBQe1V.js @@ -0,0 +1 @@ +return args.options.crewTest?.system.handling !== true; \ No newline at end of file diff --git a/reference_scripts/6oSs8qKFNFz2lSmh.js b/reference_scripts/6oSs8qKFNFz2lSmh.js new file mode 100644 index 0000000..a96cb59 --- /dev/null +++ b/reference_scripts/6oSs8qKFNFz2lSmh.js @@ -0,0 +1,2 @@ +if (args.actorsystem.details.move.sail.value > 0) + args.actor.system.details.move.sail.value = 0; diff --git a/reference_scripts/6qJP0hpShEM43ohx.js b/reference_scripts/6qJP0hpShEM43ohx.js new file mode 100644 index 0000000..437b672 --- /dev/null +++ b/reference_scripts/6qJP0hpShEM43ohx.js @@ -0,0 +1,31 @@ +const actor = args.actor; + +if (actor.itemTypes.skill.find(s => s.name === "Lore (Oceans)")) { + const loreTest = await actor.setupSkill('Lore (Oceans)', { + appendTitle: ` – ${this.effect.name}`, + skipTargets: true, + fields: {difficulty: 'hard'}, + characteristic: 'int', + }); + await loreTest.roll(); + + if (loreTest.succeeded) { + loreTest.result.other.push(`${actor.name} recognizes lure of the Leviathan.`); + loreTest.renderRollCard(); + return; + } +} + +let test = await actor.setupSkill('Cool', { + appendTitle: ` – ${this.effect.name}`, + skipTargets: true, + fields: {difficulty: 'easy'}, + characteristic: 'wp', +}); +await test.roll(); + +if (!test.succeeded) { + test.result.other.push(`${actor.name} became @Condition[Stunned] by the sight.`); + test.renderRollCard(); + actor.addCondition("stunned"); +} \ No newline at end of file diff --git a/reference_scripts/6ubojp9zwbfJnosT.js b/reference_scripts/6ubojp9zwbfJnosT.js new file mode 100644 index 0000000..0620aad --- /dev/null +++ b/reference_scripts/6ubojp9zwbfJnosT.js @@ -0,0 +1 @@ +args.actor.system.details.move.value += 1; \ No newline at end of file diff --git a/reference_scripts/7w7QA7GBhzZ98OS0.js b/reference_scripts/7w7QA7GBhzZ98OS0.js new file mode 100644 index 0000000..2227fc2 --- /dev/null +++ b/reference_scripts/7w7QA7GBhzZ98OS0.js @@ -0,0 +1,32 @@ +const sin = this.effect.sourceActor.system.status.sin.value; +const result = await WFRP_Tables.rollTable("manann-mood-made-meaningless", sin); +let match = result.text.match(/b>([^<]+)/i); +let key = match[1]; +let roll = new Roll("5d10"); +let value = undefined; + +await this.script.scriptMessage(result.text, {flavor: result.title}); + +switch (key) { + case 'Stromfels Triumphant!': + value = 0; + break; + case 'Stromfels Ascends!': + await roll.evaluate(); + if (this.actor.system.status.mood.value > 0) + value = -roll.total; + else if (this.actor.system.status.mood.value < 0) + value = roll.total; + break; + case 'No effect.': + break; + case 'Manann Provoked!': + await roll.evaluate(); + value = -roll.total; + break; +} + +if (roll._evaluated) + await roll.toMessage(); + +await this.effect.setFlag("wfrp4e-soc", "m4result", {result: key, value}); \ No newline at end of file diff --git a/reference_scripts/86ivOsBQAuu0UmFg.js b/reference_scripts/86ivOsBQAuu0UmFg.js new file mode 100644 index 0000000..e440e5a --- /dev/null +++ b/reference_scripts/86ivOsBQAuu0UmFg.js @@ -0,0 +1,6 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields : {difficulty : "hard"}, appendTitle : ` - ${this.effect.name}`, skipTargets: true}); +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("poisoned"); +} \ No newline at end of file diff --git a/reference_scripts/8xqYrBIf1Zhlwizg.js b/reference_scripts/8xqYrBIf1Zhlwizg.js new file mode 100644 index 0000000..941661b --- /dev/null +++ b/reference_scripts/8xqYrBIf1Zhlwizg.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished raisint the anchor.

`; +const test = 'Strength'; +const difficulty = 'vhard'; +const target = 20; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/9HWEDsnNxSykqbF5.js b/reference_scripts/9HWEDsnNxSykqbF5.js new file mode 100644 index 0000000..0ca9acf --- /dev/null +++ b/reference_scripts/9HWEDsnNxSykqbF5.js @@ -0,0 +1,3 @@ +args.actor.system.details.move.value += 3; +args.actor.system.status.carries.max = Math.floor(args.actor.system.status.carries.max * 0.25); +args.actor.system.details.price.gc *= 1.1; \ No newline at end of file diff --git a/reference_scripts/AFiB20FaOBmBv2Kz.js b/reference_scripts/AFiB20FaOBmBv2Kz.js new file mode 100644 index 0000000..9a000d5 --- /dev/null +++ b/reference_scripts/AFiB20FaOBmBv2Kz.js @@ -0,0 +1,2 @@ +if (args.actorsystem.details.move.sail.value > 0) + args.actor.system.details.move.sail.value = Math.floor(args.actor.system.details.move.sail.value * .5); diff --git a/reference_scripts/AaPPmnv7AtxsRVUs.js b/reference_scripts/AaPPmnv7AtxsRVUs.js new file mode 100644 index 0000000..18f4b61 --- /dev/null +++ b/reference_scripts/AaPPmnv7AtxsRVUs.js @@ -0,0 +1 @@ +args.actor.details.move.value = 1; \ No newline at end of file diff --git a/reference_scripts/BVNKF9omCppWPLys.js b/reference_scripts/BVNKF9omCppWPLys.js new file mode 100644 index 0000000..d01c1cf --- /dev/null +++ b/reference_scripts/BVNKF9omCppWPLys.js @@ -0,0 +1,28 @@ +let actor = game.user.character ?? canvas.tokens.controlled[0]?.actor; +if (!actor || !(actor.system instanceof StandardActorModel)) + return ui.notifications.warn("You must control an Actor capable of performing a Strength Test"); + +let test = await actor.setupCharacteristic("s", { + skipTargets: true, + appendTitle: " - Bailing Out", + fields: { + difficulty: "challenging" + }, + context: { + success: "Reduced the Holed rating!" + } +}); + +await test.roll(); +if (test.succeeded) { + let SL = parseInt(test.result.SL); + let name = this.effect.name.replace(/\d+/, rating => parseInt(rating) - SL); + await this.effect.update({name}); +} + +let rating = parseInt(this.effect.name.match(/\d+/)?.[0]); +if (rating <= 1) { + const scriptData = this.effect.flags.wfrp4e.scriptData; + scriptData[2].trigger = ''; + await this.effect.update({disabled: true, "flags.wfrp4e.scriptData": scriptData}); +} \ No newline at end of file diff --git a/reference_scripts/BZETMpgrI5k1ol5b.js b/reference_scripts/BZETMpgrI5k1ol5b.js new file mode 100644 index 0000000..5934888 --- /dev/null +++ b/reference_scripts/BZETMpgrI5k1ol5b.js @@ -0,0 +1,11 @@ +// If the creature currently has a Surprised, Unconscious, or Entangled Condition, it does not gain this Advantage. +const surprised = this.actor.hasCondition("surprised") +const unconscious = this.actor.hasCondition("unconscious") +const entangled = this.actor.hasCondition("entangled") +if (entangled || unconscious || surprised) return + +// If, at the beginning of its turn, this creature does not have at least Rating Advantage points, its Advantage pool immediately increases to Rating. +const grimRating = parseInt(this.item.specification.value) || 1 +if (grimRating > this.actor.status.advantage.value) { + this.actor.setAdvantage(grimRating) +} diff --git a/reference_scripts/C69xngEMghfwUx13.js b/reference_scripts/C69xngEMghfwUx13.js new file mode 100644 index 0000000..65f9299 --- /dev/null +++ b/reference_scripts/C69xngEMghfwUx13.js @@ -0,0 +1,3 @@ +let easier = ['challenging', 'average', 'easy', 'veasy']; +if (easier.includes(args.fields.difficulty)) + args.fields.difficulty = "difficult"; \ No newline at end of file diff --git a/reference_scripts/CD4RnDpXZ9hnqVPQ.js b/reference_scripts/CD4RnDpXZ9hnqVPQ.js new file mode 100644 index 0000000..d733e08 --- /dev/null +++ b/reference_scripts/CD4RnDpXZ9hnqVPQ.js @@ -0,0 +1,2 @@ +if (!this.actor.hasCondition("entangled")) + this.actor.addCondition("entangled"); \ No newline at end of file diff --git a/reference_scripts/CS6O7UUjQcUJoOUP.js b/reference_scripts/CS6O7UUjQcUJoOUP.js new file mode 100644 index 0000000..be5bc60 --- /dev/null +++ b/reference_scripts/CS6O7UUjQcUJoOUP.js @@ -0,0 +1,10 @@ +if (args.test.failed) + { + let SL = Number(args.test.result.SL) + if (SL <= -2 && SL > -4) + this.actor.addCondition("stunned") + else if (SL <= -4 && SL > -6) + this.script.scriptMessage(this.actor.prototypeToken.name + " must make a Willpower Test or fall @Condition[Prone].") + else if (SL <= -6) + this.actor.addCondition("unconscious") + } \ No newline at end of file diff --git a/reference_scripts/Dzi2CKpYapRGwNVr.js b/reference_scripts/Dzi2CKpYapRGwNVr.js new file mode 100644 index 0000000..b5561ad --- /dev/null +++ b/reference_scripts/Dzi2CKpYapRGwNVr.js @@ -0,0 +1,3 @@ +if (args.actor.system instanceof StandardActorModel) { + args.actor.addCondition("unconscious"); +} \ No newline at end of file diff --git a/reference_scripts/E3om295BMQojnM2F.js b/reference_scripts/E3om295BMQojnM2F.js new file mode 100644 index 0000000..4e0d9d6 --- /dev/null +++ b/reference_scripts/E3om295BMQojnM2F.js @@ -0,0 +1,6 @@ +let fatigued = this.actor.hasCondition("fatigued") +if (fatigued) +{ + fatigued.delete(); + this.script.scriptNotification("Removed Fatigued") +} \ No newline at end of file diff --git a/reference_scripts/EBNrA6FNX4d05EUx.js b/reference_scripts/EBNrA6FNX4d05EUx.js new file mode 100644 index 0000000..1ad25de --- /dev/null +++ b/reference_scripts/EBNrA6FNX4d05EUx.js @@ -0,0 +1 @@ +return !args.options.crewTest; \ No newline at end of file diff --git a/reference_scripts/EC8cZmqrE095cDc2.js b/reference_scripts/EC8cZmqrE095cDc2.js new file mode 100644 index 0000000..c5e0b3e --- /dev/null +++ b/reference_scripts/EC8cZmqrE095cDc2.js @@ -0,0 +1,31 @@ +const actor = args.actor; + +if (actor.itemTypes.skill.find(s => s.name === "Lore (Riverways)")) { + const loreTest = await actor.setupSkill('Lore (Riverways)', { + appendTitle: ` – ${this.effect.name}`, + skipTargets: true, + fields: {difficulty: 'hard'}, + characteristic: 'int', + }); + await loreTest.roll(); + + if (loreTest.succeeded) { + loreTest.result.other.push(`${actor.name} recognizes lures of Lurkerfish.`); + loreTest.renderRollCard(); + return; + } +} + +let test = await actor.setupSkill('Cool', { + appendTitle: ` – ${this.effect.name}`, + skipTargets: true, + fields: {difficulty: 'easy'}, + characteristic: 'wp', +}); +await test.roll(); + +if (!test.succeeded) { + test.result.other.push(`${actor.name} became beguiled by the sight and unable to perform any action except moving towards the light.`); + test.renderRollCard(); + actor.addCondition("unconscious"); +} \ No newline at end of file diff --git a/reference_scripts/EDAMEOzdBfkoKHxP.js b/reference_scripts/EDAMEOzdBfkoKHxP.js new file mode 100644 index 0000000..6b1f28e --- /dev/null +++ b/reference_scripts/EDAMEOzdBfkoKHxP.js @@ -0,0 +1 @@ +return args.skill?.name !== game.i18n.localize("NAME.Navigation"); \ No newline at end of file diff --git a/reference_scripts/F2u4L4o0r1LTWeWK.js b/reference_scripts/F2u4L4o0r1LTWeWK.js new file mode 100644 index 0000000..7f9ad7e --- /dev/null +++ b/reference_scripts/F2u4L4o0r1LTWeWK.js @@ -0,0 +1,8 @@ +if (isNaN(parseInt(this.item.system.specification.value))) +{ + let value = await ValueDialog.create("Enter Terror value", this.effect.name); + if (value) + { + this.item.updateSource({"system.specification.value" : value}); + } +} \ No newline at end of file diff --git a/reference_scripts/FPYNcxm21678boLT.js b/reference_scripts/FPYNcxm21678boLT.js new file mode 100644 index 0000000..f08a8e4 --- /dev/null +++ b/reference_scripts/FPYNcxm21678boLT.js @@ -0,0 +1,18 @@ +if (args.attackerTest.data.preData.rollClass !== "CharacteristicTest") return; +if (args.attackerTest.data.preData.characteristic !== "s") return; + +const SL = args.opposedTest.data.opposeResult.differenceSL; + +const targetId = this.effect.getFlag("wfrp4e", "target"); +const target = canvas.scene.tokens.get(targetId); + +if (SL > 4) { + args.opposedTest.data.opposeResult.other.push(`${args.defenderTest.actor.name} was forced to let go of ${target.name}.`); + return await this.effect.delete(); +} + +if (SL > 0) { + args.opposedTest.data.opposeResult.other.push(`${args.defenderTest.actor.name} was prevented from squeezing ${target.name} for one turn.`); + let turns = this.effect.getFlag("wfrp4e", "turns"); + this.effect.setFlag("wfrp4e", "turns", turns + 1); +} \ No newline at end of file diff --git a/reference_scripts/FtZf56VI6Qsspu0D.js b/reference_scripts/FtZf56VI6Qsspu0D.js new file mode 100644 index 0000000..9ae4c74 --- /dev/null +++ b/reference_scripts/FtZf56VI6Qsspu0D.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Carpenter)'; +const difficulty = 'difficult'; +const target = 20; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/Fwk8WA8NfRivLFWJ.js b/reference_scripts/Fwk8WA8NfRivLFWJ.js new file mode 100644 index 0000000..5073111 --- /dev/null +++ b/reference_scripts/Fwk8WA8NfRivLFWJ.js @@ -0,0 +1 @@ +return args.skill?.name === "Entertain (Singing)"; \ No newline at end of file diff --git a/reference_scripts/GsAyB5xnK3ASeoah.js b/reference_scripts/GsAyB5xnK3ASeoah.js new file mode 100644 index 0000000..d75b3ac --- /dev/null +++ b/reference_scripts/GsAyB5xnK3ASeoah.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Carpentry)'; +const difficulty = 'easy'; +const target = 20; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/H85k4L3yICm7cfIk.js b/reference_scripts/H85k4L3yICm7cfIk.js new file mode 100644 index 0000000..57f847c --- /dev/null +++ b/reference_scripts/H85k4L3yICm7cfIk.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Sail'; +const difficulty = 'easy'; +const target = 10; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/HUKzssLxeQo1wbx9.js b/reference_scripts/HUKzssLxeQo1wbx9.js new file mode 100644 index 0000000..f0ea092 --- /dev/null +++ b/reference_scripts/HUKzssLxeQo1wbx9.js @@ -0,0 +1,11 @@ + + let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields: {difficulty : "average"}, appendTitle : " - Wounded"}) + await test.roll(); + if (test.failed) + { + fromUuid("Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb").then(disease => { + this.actor.createEmbeddedDocuments("Item", [disease.toObject()]) + this.script.scriptNotification("Gained " + disease.name) + }) + } + \ No newline at end of file diff --git a/reference_scripts/HYrl5aNMm8BAdqH7.js b/reference_scripts/HYrl5aNMm8BAdqH7.js new file mode 100644 index 0000000..b628745 --- /dev/null +++ b/reference_scripts/HYrl5aNMm8BAdqH7.js @@ -0,0 +1,8 @@ + + let modifier = 0 + if (this.effect.name.includes("Moderate")) + modifier = -20 + else + modifier = -10 + args.fields.modifier += modifier + \ No newline at end of file diff --git a/reference_scripts/HrOBAXsEX073ReKl.js b/reference_scripts/HrOBAXsEX073ReKl.js index de65a28..89b90d3 100644 --- a/reference_scripts/HrOBAXsEX073ReKl.js +++ b/reference_scripts/HrOBAXsEX073ReKl.js @@ -6,13 +6,16 @@ if (!currentCareer) return let inCurrentCareer = currentCareer.system.skills.includes(skill); -if (existingSkill && inCurrentCareer) +let perfectPitchAdded = this.actor.getFlag("wfrp4e", "perfectPitchAdded") || {}; +if (existingSkill && inCurrentCareer && !perfectPitchAdded[existingSkill.name]) { existingSkill.system.advances.costModifier = -5; } else { + perfectPitchAdded[skill] = true; currentCareer.system.skills.push(skill); + setProperty(this.actor, "flags.wfrp4e.perfectPitchAdded", perfectPitchAdded) } diff --git a/reference_scripts/IOroJBqTsWvoakJN.js b/reference_scripts/IOroJBqTsWvoakJN.js new file mode 100644 index 0000000..504fa5a --- /dev/null +++ b/reference_scripts/IOroJBqTsWvoakJN.js @@ -0,0 +1,2 @@ +if (args.actorsystem.details.move.oars.value > 0) + args.actor.system.details.move.oars.value -= 2; diff --git a/reference_scripts/IrkWq7IiFS65bTvC.js b/reference_scripts/IrkWq7IiFS65bTvC.js new file mode 100644 index 0000000..d775da2 --- /dev/null +++ b/reference_scripts/IrkWq7IiFS65bTvC.js @@ -0,0 +1,7 @@ +if (this.actor.flags.holed.half !== true) return; +if (this.actor.flags.holed.reminded === true) return; + +const speaker = ChatMessage.getSpeaker({actor: this.actor}); +this.script.scriptMessage(`

${speaker.alias} sits heavily in the water. Unless the cargo is waterproof, it loses [[d10]]% of its value.

`); + +this.actor.flags.holed.reminded = true; \ No newline at end of file diff --git a/reference_scripts/IzoOmDywGLqLNljN.js b/reference_scripts/IzoOmDywGLqLNljN.js new file mode 100644 index 0000000..2dd5130 --- /dev/null +++ b/reference_scripts/IzoOmDywGLqLNljN.js @@ -0,0 +1,19 @@ +let skill = `Language (Magick)` +let currentCareer = this.actor.system.currentCareer; +let existingSkill = this.actor.itemTypes.skill.find(i => i.name == skill); + +if (!currentCareer) return + + +let inCurrentCareer = currentCareer.system.skills.includes(skill); +let witchAdded = actor.getFlag("wfrp4e", "witchAdded") || {}; +if (existingSkill && inCurrentCareer && !witchAdded[existingSkill.name]) +{ + existingSkill.system.advances.costModifier = -5; +} +else +{ + witchAdded[skill] = true; + currentCareer.system.skills.push(skill); + setProperty(this.actor, "flags.wfrp4e.witchAdded", witchAdded) +} \ No newline at end of file diff --git a/reference_scripts/JBoKPBr27C3PMoSD.js b/reference_scripts/JBoKPBr27C3PMoSD.js new file mode 100644 index 0000000..c1ae1c1 --- /dev/null +++ b/reference_scripts/JBoKPBr27C3PMoSD.js @@ -0,0 +1 @@ +return args.skill?.name === game.i18n.localize("NAME.Navigation"); \ No newline at end of file diff --git a/reference_scripts/JXBUE0XuJOJNG7zE.js b/reference_scripts/JXBUE0XuJOJNG7zE.js new file mode 100644 index 0000000..de285b5 --- /dev/null +++ b/reference_scripts/JXBUE0XuJOJNG7zE.js @@ -0,0 +1,18 @@ +if (args.totalWoundLoss <= 7) return; + +let options = { + appendTitle : " – " + this.effect.name, + skipTargets: true, + fields: {difficulty: 'average'}, + characteristic: 'wp', +} + +let test = await args.actor.setupSkill('Cool', options); +await test.roll(); + +if (!test.succeeded) { + const targetId = this.effect.getFlag("wfrp4e", "target"); + const target = canvas.scene.tokens.get(targetId); + await this.effect.delete(); + args.extraMessages.push(`${args.actor.name} lost ${args.totalWoundLoss} Wounds to an attack, which caused it to let go of ${target.name}.`); +} \ No newline at end of file diff --git a/reference_scripts/JhbZWZhOJ23yOBmG.js b/reference_scripts/JhbZWZhOJ23yOBmG.js new file mode 100644 index 0000000..3f7c65c --- /dev/null +++ b/reference_scripts/JhbZWZhOJ23yOBmG.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Carpentry)'; +const difficulty = 'hard'; +const target = 30; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/LjfScVGBf0Egr70E.js b/reference_scripts/LjfScVGBf0Egr70E.js new file mode 100644 index 0000000..07e1a29 --- /dev/null +++ b/reference_scripts/LjfScVGBf0Egr70E.js @@ -0,0 +1,9 @@ +let animalCare = this.actor.itemTypes.skill.find(s => s.name === game.i18n.localize("NAME.AnimalCare")); +let animalTrainings = this.actor.itemTypes.skill.filter(s => s.name.includes(game.i18n.localize("NAME.AnimalTraining"))); + +if (animalCare) + animalCare.system.modifier.value += 20; + +for (let training of animalTrainings) { + training.system.modifier.value += 30; +} \ No newline at end of file diff --git a/reference_scripts/MIhYSuJ6MI9B65UT.js b/reference_scripts/MIhYSuJ6MI9B65UT.js new file mode 100644 index 0000000..a1d2254 --- /dev/null +++ b/reference_scripts/MIhYSuJ6MI9B65UT.js @@ -0,0 +1,4 @@ +let specification = Number(this.item.specification.value) || 1; +args.actor.system.status.wounds.max += Math.floor(args.actor.system.status.wounds.max * 0.3 * specification); +args.actor.system.status.carries.max -= Math.floor(args.actor.system.status.carries.max * 0.1 * specification); +args.actor.system.details.price.gc += Math.floor(args.actor.system.details.price.gc * 0.2 * specification); \ No newline at end of file diff --git a/reference_scripts/MMv2B8TH7jxNCtdl.js b/reference_scripts/MMv2B8TH7jxNCtdl.js new file mode 100644 index 0000000..a366058 --- /dev/null +++ b/reference_scripts/MMv2B8TH7jxNCtdl.js @@ -0,0 +1,52 @@ +let actor = this.actor; + let effect = this.effect; + let bleedingAmt; + let bleedingRoll; + let msg = "" + + let damage = effect.conditionValue; + let scriptArgs = {msg, damage}; + await Promise.all(actor.runScripts("preApplyCondition", {effect, data : scriptArgs})) + msg = scriptArgs.msg; + damage = scriptArgs.damage; + msg += await actor.applyBasicDamage(damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, minimumOne : false, suppressMsg : true}) + + if (actor.status.wounds.value == 0 && !actor.hasCondition("unconscious")) + { + await actor.addCondition("unconscious") + msg += "
" + game.i18n.format("BleedUnc", {name: actor.prototypeToken.name }) + } + + if (actor.hasCondition("unconscious")) + { + bleedingAmt = effect.conditionValue; + bleedingRoll = (await new Roll("1d100").roll()).total; + if (bleedingRoll <= bleedingAmt * 10) + { + msg += "
" + game.i18n.format("BleedFail", {name: actor.prototypeToken.name}) + " (" + game.i18n.localize("Rolled") + " " + bleedingRoll + ")"; + await actor.addCondition("dead") + } + else if (bleedingRoll % 11 == 0) + { + msg += "
" + game.i18n.format("BleedCrit", { name: actor.prototypeToken.name } ) + " (" + game.i18n.localize("Rolled") + bleedingRoll + ")" + await actor.removeCondition("bleeding") + } + else + { + msg += "
" + game.i18n.localize("BleedRoll") + ": " + bleedingRoll; + } + } + + await Promise.all(actor.runScripts("applyCondition", {effect, data : {bleedingRoll}})) + if (args.suppressMessage) + { + let messageData = game.wfrp4e.utility.chatDataSetup(msg); + messageData.speaker = {alias: this.effect.name} + messageData.flavor = this.effect.name; + return messageData + } + else + { + return this.script.scriptMessage(msg) + } + \ No newline at end of file diff --git a/reference_scripts/MMx8f5uJ15XOgJGg.js b/reference_scripts/MMx8f5uJ15XOgJGg.js new file mode 100644 index 0000000..8146820 --- /dev/null +++ b/reference_scripts/MMx8f5uJ15XOgJGg.js @@ -0,0 +1 @@ +return args.skill?.name !== game.i18n.localize("NAME.Row") && args.skill?.name !== game.i18n.localize("NAME.Swim") && !args.skill?.name.includes(game.i18n.localize("NAME.Sail")); \ No newline at end of file diff --git a/reference_scripts/Me1wS5XdqUEy7OGt.js b/reference_scripts/Me1wS5XdqUEy7OGt.js new file mode 100644 index 0000000..42fc77d --- /dev/null +++ b/reference_scripts/Me1wS5XdqUEy7OGt.js @@ -0,0 +1,5 @@ +let loc = (await game.wfrp4e.tables.rollTable("hitloc")).result; +let critTable = `crit${this.generalizeTable(loc)`; +let crit = (await game.wfrp4e.tables.rollTable(critTable)).result; + +this.script.scriptMessage(`{this.actor.name} suffers a ${crit} (location : ${loc}). Do not apply bleeding or any additonnal wounds.`); \ No newline at end of file diff --git a/reference_scripts/NI3ZzIAlpQfVSjvf.js b/reference_scripts/NI3ZzIAlpQfVSjvf.js new file mode 100644 index 0000000..3955b1a --- /dev/null +++ b/reference_scripts/NI3ZzIAlpQfVSjvf.js @@ -0,0 +1,8 @@ +if (isNaN(parseInt(this.item.system.specification.value))) +{ + let value = await ValueDialog.create("Enter Fear value", this.item.name); + if (value) + { + this.item.updateSource({"system.specification.value" : value}); + } +} \ No newline at end of file diff --git a/reference_scripts/O45vpR4jDbQQnmvJ.js b/reference_scripts/O45vpR4jDbQQnmvJ.js new file mode 100644 index 0000000..dceb5f0 --- /dev/null +++ b/reference_scripts/O45vpR4jDbQQnmvJ.js @@ -0,0 +1,13 @@ +let items = []; + +let etiquette = (await fromUuid("Compendium.wfrp4e-core.items.Item.sYbgpSnRqSZWgwFP")).toObject(); +etiquette.name += " (Followers of Khorne)"; + +items.push(etiquette); + +let animosity = (await fromUuid("Compendium.wfrp4e-core.items.Item.Q2MCUrG2HppMcvN0")).toObject(); +animosity.name = animosity.name.replace("(Target)", "(Followers of Slaanesh)"); + +items.push(animosity); + +await this.actor.createEmbeddedDocuments("Item", items, {fromEffect : this.effect.id}); diff --git a/reference_scripts/OsLXutfXyQCAkhAf.js b/reference_scripts/OsLXutfXyQCAkhAf.js new file mode 100644 index 0000000..7d8b91f --- /dev/null +++ b/reference_scripts/OsLXutfXyQCAkhAf.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Sail'; +const difficulty = 'average'; +const target = 30; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/Pn5fekTbkwlr61XU.js b/reference_scripts/Pn5fekTbkwlr61XU.js new file mode 100644 index 0000000..63064a6 --- /dev/null +++ b/reference_scripts/Pn5fekTbkwlr61XU.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Engineer)'; +const difficulty = 'easy'; +const target = 10; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/PsO7aTdELJt35eHP.js b/reference_scripts/PsO7aTdELJt35eHP.js new file mode 100644 index 0000000..08dcbea --- /dev/null +++ b/reference_scripts/PsO7aTdELJt35eHP.js @@ -0,0 +1,10 @@ +let morale = await new Roll("-1d10").roll(); +let mood = await new Roll("-2d10").roll(); + +morale.toMessage(this.script.getChatData({flavor : "Morale"})); +mood.toMessage(this.script.getChatData({flavor : "Manann's Mood"})); + +await this.actor.system.status.morale.addEntry("Albatross Died", morale.total) +await this.actor.system.status.mood.addEntry("Albatross Died", mood.total); + +this.effect.delete(); \ No newline at end of file diff --git a/reference_scripts/Q5gh5Y9dCdclcwsD.js b/reference_scripts/Q5gh5Y9dCdclcwsD.js new file mode 100644 index 0000000..50f5352 --- /dev/null +++ b/reference_scripts/Q5gh5Y9dCdclcwsD.js @@ -0,0 +1 @@ +return !args.skill?.name.includes(game.i18n.localize("NAME.Channelling")) && args.skill?.name != `${game.i18n.localize("NAME.Language")} (${game.i18n.localize("SPEC.Magick")})` \ No newline at end of file diff --git a/reference_scripts/Q7eULXQ9AfDRmUGO.js b/reference_scripts/Q7eULXQ9AfDRmUGO.js new file mode 100644 index 0000000..233c0f9 --- /dev/null +++ b/reference_scripts/Q7eULXQ9AfDRmUGO.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Carpenter)'; +const difficulty = 'difficult'; +const target = 40; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/QHQ7XmFOjT9wXgw1.js b/reference_scripts/QHQ7XmFOjT9wXgw1.js new file mode 100644 index 0000000..3a516b8 --- /dev/null +++ b/reference_scripts/QHQ7XmFOjT9wXgw1.js @@ -0,0 +1,4 @@ +if (args.actorsystem.details.move.oars.value > 0) + args.actor.system.details.move.oars.value -= 1; + +args.actor.system.details.man -= 2; \ No newline at end of file diff --git a/reference_scripts/QNxmImpLTou6WdMQ.js b/reference_scripts/QNxmImpLTou6WdMQ.js new file mode 100644 index 0000000..0e082dd --- /dev/null +++ b/reference_scripts/QNxmImpLTou6WdMQ.js @@ -0,0 +1,3 @@ +let test = args.test +if (test.result.minormis || test.result.majormis || test.result.catastrophicmis) + test.result.other.push("Can make a Difficult (-10) Willpower Test to prevent the Miscast") \ No newline at end of file diff --git a/reference_scripts/QfTBRGXVfwQSghmd.js b/reference_scripts/QfTBRGXVfwQSghmd.js new file mode 100644 index 0000000..99a5992 --- /dev/null +++ b/reference_scripts/QfTBRGXVfwQSghmd.js @@ -0,0 +1,18 @@ +fromUuid(this.effect.origin).then(caster => { + if (caster) { + if (actor.items.find(it => it.name == game.i18n.localize("Bestial"))) { + let healed = caster.characteristics.wp.bonus + let wounds = duplicate(args.actor.status.wounds) + wounds.value += healed + + if (wounds.value > wounds.max) + wounds.value = wounds.max + + args.actor.update({ "system.status.wounds": wounds }) + ChatMessage.create({ content: `${this.actor.prototypeToken.name} regains ${healed} Wounds`, speaker: { alias: this.effect.name } }) + } else { + ui.notifications.warn("Target actor has no Bestial trait") + } + } +}) + diff --git a/reference_scripts/R8FBHZaaARA3z9pB.js b/reference_scripts/R8FBHZaaARA3z9pB.js new file mode 100644 index 0000000..29b9079 --- /dev/null +++ b/reference_scripts/R8FBHZaaARA3z9pB.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Carpenter)'; +const difficulty = 'hard'; +const target = 40; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/R8ecKGRzOr4ThvVa.js b/reference_scripts/R8ecKGRzOr4ThvVa.js new file mode 100644 index 0000000..875dec8 --- /dev/null +++ b/reference_scripts/R8ecKGRzOr4ThvVa.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Maintenance Crew Test'; +const difficulty = 'hard'; +const target = 80; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/RPqgRUkiLY5thVbC.js b/reference_scripts/RPqgRUkiLY5thVbC.js new file mode 100644 index 0000000..cc3928e --- /dev/null +++ b/reference_scripts/RPqgRUkiLY5thVbC.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Strength'; +const difficulty = 'average'; +const target = 10; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/RlhOAKfN0ghrrooR.js b/reference_scripts/RlhOAKfN0ghrrooR.js new file mode 100644 index 0000000..b0e5aae --- /dev/null +++ b/reference_scripts/RlhOAKfN0ghrrooR.js @@ -0,0 +1,7 @@ +let holed = this.actor.appliedEffects.filter(e => e.name.includes("Holed")); + +for (let effect of holed) { + await effect.update({name: effect.name.replace(/\d+/, rating => parseInt(rating) * 2)}); +} + +this.script.scriptNotification(`Holed Ratings of ${this.actor.name} have been doubled.`); \ No newline at end of file diff --git a/reference_scripts/Rnpw6UQdJifLeuna.js b/reference_scripts/Rnpw6UQdJifLeuna.js new file mode 100644 index 0000000..b9fc369 --- /dev/null +++ b/reference_scripts/Rnpw6UQdJifLeuna.js @@ -0,0 +1 @@ +this.effect.updateSource({"flags.wfrp4e.applicationData.type" : "crew"}) \ No newline at end of file diff --git a/reference_scripts/RsWXCcYHONf3ANlD.js b/reference_scripts/RsWXCcYHONf3ANlD.js new file mode 100644 index 0000000..8924600 --- /dev/null +++ b/reference_scripts/RsWXCcYHONf3ANlD.js @@ -0,0 +1 @@ +this.actor.addCondition("stunned", 1); diff --git a/reference_scripts/RwMw848y13Jq2L4f.js b/reference_scripts/RwMw848y13Jq2L4f.js new file mode 100644 index 0000000..d6186a0 --- /dev/null +++ b/reference_scripts/RwMw848y13Jq2L4f.js @@ -0,0 +1,23 @@ +let test = await this.actor.setupSkill("Endurance", {fields : {difficulty : "difficult"}, appendTitle : ` - ${this.effect.name}`}); +await test.roll(); +if (test.failed) +{ + await this.actor.addCondition("blinded"); +} + +let msg = `` +let armour = args.actor.itemTypes.armour.filter(i => i.system.isMetal && i.system.isEquipped); +for(let item of armour) +{ + for(let key in item.system.AP) + { + let AP = item.system.AP[key] + let damage = Math.floor(AP / 2); + await item.system.damageItem(damage, [key]); + } + msg += `

${item.name} AP reduced by half

` +} +if (msg) +{ + this.script.scriptMessage(msg, {speaker : {alias : args.actor.name}}); +} \ No newline at end of file diff --git a/reference_scripts/SWIJjM2RCmzfr64u.js b/reference_scripts/SWIJjM2RCmzfr64u.js index 5a07e2e..4f762e1 100644 --- a/reference_scripts/SWIJjM2RCmzfr64u.js +++ b/reference_scripts/SWIJjM2RCmzfr64u.js @@ -1,4 +1,4 @@ -if (args.test.result.hitloc.result == "head") +if (args.test.result.hitloc.result == "head" && args.test.result.critical) { args.test.result.critModifier = args.test.result.critModifier ? args.test.result.critModifier + 40 : 40 diff --git a/reference_scripts/SefcrhXsdYGFcCW6.js b/reference_scripts/SefcrhXsdYGFcCW6.js new file mode 100644 index 0000000..13bf563 --- /dev/null +++ b/reference_scripts/SefcrhXsdYGFcCW6.js @@ -0,0 +1,3 @@ +args.actor.system.details.move.value -= 3; +args.actor.system.details.man -= 2; +args.actor.system.status.carries.max *= 2; \ No newline at end of file diff --git a/reference_scripts/Ssn21dxoMQiqD1y4.js b/reference_scripts/Ssn21dxoMQiqD1y4.js new file mode 100644 index 0000000..6767d5a --- /dev/null +++ b/reference_scripts/Ssn21dxoMQiqD1y4.js @@ -0,0 +1 @@ +return args.type == "cast" && args.item.lore.value == "fire" \ No newline at end of file diff --git a/reference_scripts/T3RfSt3VMEat3iDD.js b/reference_scripts/T3RfSt3VMEat3iDD.js new file mode 100644 index 0000000..747d789 --- /dev/null +++ b/reference_scripts/T3RfSt3VMEat3iDD.js @@ -0,0 +1 @@ +return args.skill?.name !== game.i18n.localize("NAME.Perception"); \ No newline at end of file diff --git a/reference_scripts/UDPsaymtZf39UsMk.js b/reference_scripts/UDPsaymtZf39UsMk.js new file mode 100644 index 0000000..ba3519f --- /dev/null +++ b/reference_scripts/UDPsaymtZf39UsMk.js @@ -0,0 +1,7 @@ + + let fatigued = this.actor.hasCondition("fatigued") + if (!fatigued) + { + this.actor.addCondition("fatigued") + ui.notifications.notify("Fatigued added to " + this.actor.name + " which cannot be removed until the Malaise symptom is gone.") + } \ No newline at end of file diff --git a/reference_scripts/UXdlnmwVgjc1QpF2.js b/reference_scripts/UXdlnmwVgjc1QpF2.js new file mode 100644 index 0000000..999ec85 --- /dev/null +++ b/reference_scripts/UXdlnmwVgjc1QpF2.js @@ -0,0 +1,2 @@ +args.actor.system.details.move.value += 1; +args.actor.system.status.carries.max = Math.floor(args.actor.system.status.carries.max * 0.75); \ No newline at end of file diff --git a/reference_scripts/UlRSaZG4ZUU6fMND.js b/reference_scripts/UlRSaZG4ZUU6fMND.js new file mode 100644 index 0000000..7e0b3e6 --- /dev/null +++ b/reference_scripts/UlRSaZG4ZUU6fMND.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Carpenter)'; +const difficulty = 'challenging'; +const target = 10; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/UtqUthabeQ4rHDLQ.js b/reference_scripts/UtqUthabeQ4rHDLQ.js new file mode 100644 index 0000000..291bca4 --- /dev/null +++ b/reference_scripts/UtqUthabeQ4rHDLQ.js @@ -0,0 +1,2 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.Item.tNWrJUOArwfWXsPw"); +this.actor.createEmbeddedDocuments("Item", [item], {fromEffect: this.effect.id}); \ No newline at end of file diff --git a/reference_scripts/Uvk1X7sEhvv77YkD.js b/reference_scripts/Uvk1X7sEhvv77YkD.js new file mode 100644 index 0000000..ea8388a --- /dev/null +++ b/reference_scripts/Uvk1X7sEhvv77YkD.js @@ -0,0 +1,5 @@ +if (!args.flags.distractingApplied) +{ + args.fields.modifier -= 20; + args.flags.distractingApplied = true; +} \ No newline at end of file diff --git a/reference_scripts/VINX6TBAJQznhVcN.js b/reference_scripts/VINX6TBAJQznhVcN.js new file mode 100644 index 0000000..87ceb4a --- /dev/null +++ b/reference_scripts/VINX6TBAJQznhVcN.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished replacing ${this.item.name} with a makeshift one.

`; +const test = 'Maintenance Crew Test'; +const difficulty = 'hard'; +const target = 80; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/VLdF2HPnCrNIgp7a.js b/reference_scripts/VLdF2HPnCrNIgp7a.js new file mode 100644 index 0000000..a04183d --- /dev/null +++ b/reference_scripts/VLdF2HPnCrNIgp7a.js @@ -0,0 +1,13 @@ +let items = []; + +let etiquette = (await fromUuid("Compendium.wfrp4e-core.items.Item.sYbgpSnRqSZWgwFP")).toObject(); +etiquette.name += " (Followers of Khorne)"; + +items.push(etiquette); + +let animosity = (await fromUuid("Compendium.wfrp4e-core.items.Item.0VpT5yubw4UL7j6f")).toObject(); + animosity.system.specification.value = "Followers of Slaanesh"; + +items.push(animosity); + +await this.actor.createEmbeddedDocuments("Item", items, {fromEffect : this.effect.id}); diff --git a/reference_scripts/VTS4RzbmReI87K9a.js b/reference_scripts/VTS4RzbmReI87K9a.js new file mode 100644 index 0000000..7281d15 --- /dev/null +++ b/reference_scripts/VTS4RzbmReI87K9a.js @@ -0,0 +1 @@ +args.fields.slBonus = Math.floor(this.item.system.total.value * 0.1); \ No newline at end of file diff --git a/reference_scripts/VlHuDIAvPr8JM1P5.js b/reference_scripts/VlHuDIAvPr8JM1P5.js new file mode 100644 index 0000000..3f2a904 --- /dev/null +++ b/reference_scripts/VlHuDIAvPr8JM1P5.js @@ -0,0 +1 @@ +return args.skill?.name !== game.i18n.localize("NAME.Row"); \ No newline at end of file diff --git a/reference_scripts/Vns6WrafVq8NjX7t.js b/reference_scripts/Vns6WrafVq8NjX7t.js new file mode 100644 index 0000000..3b16346 --- /dev/null +++ b/reference_scripts/Vns6WrafVq8NjX7t.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.Heal") \ No newline at end of file diff --git a/reference_scripts/WJkwIrdj4NceOYe8.js b/reference_scripts/WJkwIrdj4NceOYe8.js new file mode 100644 index 0000000..47fd0a7 --- /dev/null +++ b/reference_scripts/WJkwIrdj4NceOYe8.js @@ -0,0 +1 @@ +return args.characteristic !== 'fel'; \ No newline at end of file diff --git a/reference_scripts/WR0Kqn8CF5iwToak.js b/reference_scripts/WR0Kqn8CF5iwToak.js new file mode 100644 index 0000000..60fd32e --- /dev/null +++ b/reference_scripts/WR0Kqn8CF5iwToak.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Tailor)'; +const difficulty = 'difficult'; +const target = 40; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/WeTlTniskT3Ej6vg.js b/reference_scripts/WeTlTniskT3Ej6vg.js new file mode 100644 index 0000000..5ae3d41 --- /dev/null +++ b/reference_scripts/WeTlTniskT3Ej6vg.js @@ -0,0 +1 @@ +args.modifiers.other.push({label : this.effect.name, value : 2}) \ No newline at end of file diff --git a/reference_scripts/X08401eOhKJrhNf1.js b/reference_scripts/X08401eOhKJrhNf1.js new file mode 100644 index 0000000..cb65e67 --- /dev/null +++ b/reference_scripts/X08401eOhKJrhNf1.js @@ -0,0 +1,9 @@ +const grim = this.actor.items.find(i => i.type === "trait" && i.name.includes("Grim")); + +if (args.options?.deltaAdv > 0 && this.actor.hasCondition("engaged") && grim.specification.value !== 4) { + grim.update({"system.specification.value": 4}); +} + +if (!this.actor.hasCondition("engaged") && grim.specification.value !== 2) { + grim.update({"system.specification.value": 2}); +} \ No newline at end of file diff --git a/reference_scripts/X3vpmNUj9SL2CDnF.js b/reference_scripts/X3vpmNUj9SL2CDnF.js new file mode 100644 index 0000000..329c5ee --- /dev/null +++ b/reference_scripts/X3vpmNUj9SL2CDnF.js @@ -0,0 +1,2 @@ +let item = args.actor.items.find(i => i.name.includes("Flying Jib")); +item.name += ` (Disabled by ${this.item.name})`; \ No newline at end of file diff --git a/reference_scripts/XCAfy460IotarQek.js b/reference_scripts/XCAfy460IotarQek.js new file mode 100644 index 0000000..92b4e92 --- /dev/null +++ b/reference_scripts/XCAfy460IotarQek.js @@ -0,0 +1 @@ +return false; \ No newline at end of file diff --git a/reference_scripts/YySjPfSAPdMAfjsh.js b/reference_scripts/YySjPfSAPdMAfjsh.js new file mode 100644 index 0000000..f6d648c --- /dev/null +++ b/reference_scripts/YySjPfSAPdMAfjsh.js @@ -0,0 +1,11 @@ +let talents = ["Berserk Charge", "Combat Aware", "Combat Reflexes", "Furious Assault", "Implacable", "Magic Resistance", "Resistance (Magic)", "Resolute", "Strike Mighty Blow", "Warrior Born"]; +let currentCareer = this.actor.system.currentCareer; + +if (!currentCareer) return; + +for (let talent of talents) { + if (currentCareer.system.talents.includes(talent)) + continue; + currentCareer.system.talents.push(talent); +} + diff --git a/reference_scripts/Z41L3MwOpJdAjVaj.js b/reference_scripts/Z41L3MwOpJdAjVaj.js new file mode 100644 index 0000000..e772071 --- /dev/null +++ b/reference_scripts/Z41L3MwOpJdAjVaj.js @@ -0,0 +1,2 @@ +if (args.actorsystem.details.move.sail.value > 0) + args.actor.system.details.move.sail.value -= 2; diff --git a/reference_scripts/ZCBcwbVFHFTFRntb.js b/reference_scripts/ZCBcwbVFHFTFRntb.js new file mode 100644 index 0000000..da61c9c --- /dev/null +++ b/reference_scripts/ZCBcwbVFHFTFRntb.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Carpentry)'; +const difficulty = 'easy'; +const target = 10; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/ZLspFT2I3ZdWWr2H.js b/reference_scripts/ZLspFT2I3ZdWWr2H.js new file mode 100644 index 0000000..a3fa949 --- /dev/null +++ b/reference_scripts/ZLspFT2I3ZdWWr2H.js @@ -0,0 +1 @@ +return args.skill?.name !== game.i18n.localize("NAME.Leadership"); \ No newline at end of file diff --git a/reference_scripts/ZOgtDW3mkTfeyc5M.js b/reference_scripts/ZOgtDW3mkTfeyc5M.js new file mode 100644 index 0000000..5e590a8 --- /dev/null +++ b/reference_scripts/ZOgtDW3mkTfeyc5M.js @@ -0,0 +1 @@ +args.actor.system.details.price.gc += args.actor.system.details.price.gc * 0.1; \ No newline at end of file diff --git a/reference_scripts/ZRoG7GiMDQWso6gN.js b/reference_scripts/ZRoG7GiMDQWso6gN.js new file mode 100644 index 0000000..3dbc1f6 --- /dev/null +++ b/reference_scripts/ZRoG7GiMDQWso6gN.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Carpentry)'; +const difficulty = 'difficult'; +const target = 30; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/ZuoIVv3nmlGhhdx0.js b/reference_scripts/ZuoIVv3nmlGhhdx0.js new file mode 100644 index 0000000..3c729c7 --- /dev/null +++ b/reference_scripts/ZuoIVv3nmlGhhdx0.js @@ -0,0 +1,4 @@ +let rating = parseInt(this.effect.name.match(/\d+/)?.[0]) || 1; +let holed = this.actor.flags.holed || {holed: 0}; +holed.holed += rating; +this.actor.flags.holed = holed; diff --git a/reference_scripts/araS9qYWOAVrV8F7.js b/reference_scripts/araS9qYWOAVrV8F7.js new file mode 100644 index 0000000..7415a12 --- /dev/null +++ b/reference_scripts/araS9qYWOAVrV8F7.js @@ -0,0 +1,2 @@ +args.actor.system.details.man -= 3; +args.actor.system.details.move.value -= 2; \ No newline at end of file diff --git a/reference_scripts/b8G4cjfn3RG2tEYX.js b/reference_scripts/b8G4cjfn3RG2tEYX.js new file mode 100644 index 0000000..692d5e5 --- /dev/null +++ b/reference_scripts/b8G4cjfn3RG2tEYX.js @@ -0,0 +1 @@ +this.actor.addCondition("ablaze", 3); \ No newline at end of file diff --git a/reference_scripts/bL98Sr1TRLMPEdlk.js b/reference_scripts/bL98Sr1TRLMPEdlk.js new file mode 100644 index 0000000..7f837ba --- /dev/null +++ b/reference_scripts/bL98Sr1TRLMPEdlk.js @@ -0,0 +1,4 @@ +if (args.test.failed) +{ + this.actor.addCondition("fatigued"); +} \ No newline at end of file diff --git a/reference_scripts/bRiFHPC1StKxqNIC.js b/reference_scripts/bRiFHPC1StKxqNIC.js new file mode 100644 index 0000000..0879a8c --- /dev/null +++ b/reference_scripts/bRiFHPC1StKxqNIC.js @@ -0,0 +1,6 @@ +if (isNaN(parseInt(this.item.system.specification.value))) { + let value = await ValueDialog.create("Sturdy Value", "Enter the Sturdy value"); + if (value) { + this.item.updateSource({"system.specification.value" : value}); + } +} \ No newline at end of file diff --git a/reference_scripts/cJFDnq1HI4gXWcJo.js b/reference_scripts/cJFDnq1HI4gXWcJo.js index 7371b34..427e3a8 100644 --- a/reference_scripts/cJFDnq1HI4gXWcJo.js +++ b/reference_scripts/cJFDnq1HI4gXWcJo.js @@ -1,6 +1,6 @@ if (isNaN(parseInt(this.item.system.specification.value))) { - let value = await ValueDialog.create("Ward Value", "Enter the Ward value"); + let value = await ValueDialog.create("Enter Ward value", this.effect.name); if (value) { this.item.updateSource({"system.specification.value" : value}); diff --git a/reference_scripts/cTYNaKbepMwqYsZ8.js b/reference_scripts/cTYNaKbepMwqYsZ8.js new file mode 100644 index 0000000..20d2172 --- /dev/null +++ b/reference_scripts/cTYNaKbepMwqYsZ8.js @@ -0,0 +1,16 @@ + + let difficulty = "" + if (this.effect.name.includes("Moderate")) + difficulty = "easy" + else if (this.effect.name.includes("Severe")) + difficulty = "average" + else + difficulty = "veasy" + + let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {context : {failure : this.actor.name + " dies from Blight"}, fields: {difficulty}, appendTitle : " - Blight"}) + await test.roll(); + if (test.failed) + { + this.actor.addCondition("dead"); + } + \ No newline at end of file diff --git a/reference_scripts/ckKbPfaTiQ2qBZdR.js b/reference_scripts/ckKbPfaTiQ2qBZdR.js new file mode 100644 index 0000000..39c15b2 --- /dev/null +++ b/reference_scripts/ckKbPfaTiQ2qBZdR.js @@ -0,0 +1 @@ +console.log("DAMAGE", this) \ No newline at end of file diff --git a/reference_scripts/dULCkRxtisuzQyuK.js b/reference_scripts/dULCkRxtisuzQyuK.js new file mode 100644 index 0000000..aa8b036 --- /dev/null +++ b/reference_scripts/dULCkRxtisuzQyuK.js @@ -0,0 +1,2 @@ +if (args.options.condition) + this.effect.delete(); \ No newline at end of file diff --git a/reference_scripts/dWr3tkFoIzsAgelu.js b/reference_scripts/dWr3tkFoIzsAgelu.js new file mode 100644 index 0000000..d674e39 --- /dev/null +++ b/reference_scripts/dWr3tkFoIzsAgelu.js @@ -0,0 +1,11 @@ +let injury = this.effect.itemTargets[0] +if (injury && this.effect.sourceTest.result.outcome == "success") { + let days = new Roll(injury.system.duration.value).roll( {async: false} ).total + let num = 1 + Number(this.effect.sourceTest.result.SL); + let roll = await new Roll(num+'d10').roll({async: false}) + await roll.toMessage(this.script.getChatData()) + let newDays = Math.max(days - roll.total, 1) + this.actor.updateEmbeddedDocuments("Item", [{_id: injury.id, 'system.duration.value': newDays} ]) + let message = "Injury reduces to "+newDays+" (-" + roll.total + ") instead of "+days + this.script.scriptMessage(message) +} diff --git a/reference_scripts/dbHv7dAXgB2Oy1Fg.js b/reference_scripts/dbHv7dAXgB2Oy1Fg.js new file mode 100644 index 0000000..bb1fa09 --- /dev/null +++ b/reference_scripts/dbHv7dAXgB2Oy1Fg.js @@ -0,0 +1,3 @@ +let nbBleeding = 1 + Number(this.effect.sourceTest.result.SL); +this.actor.removeCondition("bleeding", nbBleeding); +console.log(this.actor); diff --git a/reference_scripts/dh5mAlaOOLCBC0YQ.js b/reference_scripts/dh5mAlaOOLCBC0YQ.js new file mode 100644 index 0000000..9dae7e4 --- /dev/null +++ b/reference_scripts/dh5mAlaOOLCBC0YQ.js @@ -0,0 +1 @@ +args.actor.system.details.length.value += args.actor.system.details.length.value * 0.1; \ No newline at end of file diff --git a/reference_scripts/dsXGavzXLerXR8Xg.js b/reference_scripts/dsXGavzXLerXR8Xg.js new file mode 100644 index 0000000..fb7fc0e --- /dev/null +++ b/reference_scripts/dsXGavzXLerXR8Xg.js @@ -0,0 +1 @@ +return !args.skill?.name.includes(game.i18n.localize("NAME.Sail")) && !args.skill?.name.includes(game.i18n.localize("NAME.Row")) \ No newline at end of file diff --git a/reference_scripts/dxxDFXNNqUsuMyUD.js b/reference_scripts/dxxDFXNNqUsuMyUD.js new file mode 100644 index 0000000..b0dbc02 --- /dev/null +++ b/reference_scripts/dxxDFXNNqUsuMyUD.js @@ -0,0 +1 @@ +args.fields.slBonus += 1 \ No newline at end of file diff --git a/reference_scripts/e4HotRnEiyXR0pIu.js b/reference_scripts/e4HotRnEiyXR0pIu.js new file mode 100644 index 0000000..94eae28 --- /dev/null +++ b/reference_scripts/e4HotRnEiyXR0pIu.js @@ -0,0 +1 @@ +this.actor.applyEffect({effectUuids : this.item.effects.contents[1].uuid}) \ No newline at end of file diff --git a/reference_scripts/f29Pv6TQtgILxt1h.js b/reference_scripts/f29Pv6TQtgILxt1h.js new file mode 100644 index 0000000..575fef3 --- /dev/null +++ b/reference_scripts/f29Pv6TQtgILxt1h.js @@ -0,0 +1,11 @@ +if (args.test.options.healWounds) { + if (args.test.result.roll <= game.settings.get("wfrp4e", "automaticSuccess") || args.test.result.roll <= args.test.target) { + let wounds = this.actor.characteristics.int.bonus + ~~args.test.result.SL + if (args.test.options.fieldDressing && args.test.result.reversed) + wounds = this.actor.characteristics.int.bonus + Math.min(1, Number(args.test.result.SL)) + args.test.result.woundsHealed = wounds + args.test.result.other.push(`${this.actor.name} healed ${wounds} wounds of the patient.`) + } + else if (this.actor.characteristics.int.bonus + args.test.result.SL < 0) + args.test.result.other.push(`The patient contracts a @UUID[Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg]{Minor Infection}.`) +} \ No newline at end of file diff --git a/reference_scripts/fFi9JD4uCY9DPC5B.js b/reference_scripts/fFi9JD4uCY9DPC5B.js new file mode 100644 index 0000000..c8fc681 --- /dev/null +++ b/reference_scripts/fFi9JD4uCY9DPC5B.js @@ -0,0 +1,4 @@ +let specification = Number(this.item.specification.value) || 1; +args.actor.system.characteristics.t.initial += 10 * specification; +args.actor.system.status.carries.max -= Math.floor(args.actor.system.status.carries.max * 0.1 * specification); +args.actor.system.details.price.gc += Math.floor(args.actor.system.details.price.gc * 0.1 * specification); \ No newline at end of file diff --git a/reference_scripts/fTw3mpSUOlkqVVUC.js b/reference_scripts/fTw3mpSUOlkqVVUC.js new file mode 100644 index 0000000..861c31d --- /dev/null +++ b/reference_scripts/fTw3mpSUOlkqVVUC.js @@ -0,0 +1 @@ +this.actor.applyEffect({effectUuids : this.item.effects.contents[0].uuid}) \ No newline at end of file diff --git a/reference_scripts/g0SzfsLyW7aD2F19.js b/reference_scripts/g0SzfsLyW7aD2F19.js index e319818..e0ff529 100644 --- a/reference_scripts/g0SzfsLyW7aD2F19.js +++ b/reference_scripts/g0SzfsLyW7aD2F19.js @@ -1,4 +1,4 @@ -if (this.item.name.includes("(") && this.item.system.tests.value.includes("(Social Group)")) +if (this.item.system.tests.value.includes("(Social Group)")) { let tests = this.item.system.tests.value let name = this.item.name @@ -9,5 +9,14 @@ if (this.item.name.includes("(") && this.item.system.tests.value.includes("(Soci let group = name.split("(")[1].split(")")[0] tests = `${tests.split("(")[0].trim()} (${group})` } + else if (!name.includes("(")) + { + let value = await ValueDialog.create("Enter Etiquette Group", this.effect.name); + if (value) + { + name = this.item.name + ` (${value})`; + tests = this.item.system.tests.value.replace("Social Group", value); + } + } this.item.updateSource({name, "system.tests.value" : tests}) } \ No newline at end of file diff --git a/reference_scripts/gMIenSmLklAkB2Zm.js b/reference_scripts/gMIenSmLklAkB2Zm.js new file mode 100644 index 0000000..118f64a --- /dev/null +++ b/reference_scripts/gMIenSmLklAkB2Zm.js @@ -0,0 +1,8 @@ +if (isNaN(parseInt(this.item.system.specification.value))) +{ + let value = await ValueDialog.create("Enter Venom Strength", this.effect.name, "", Object.values(game.wfrp4e.config.difficultyNames)); + if (value) + { + this.item.updateSource({"system.specification.value" : value}); + } +} \ No newline at end of file diff --git a/reference_scripts/gOm8utR3HLQBT5hA.js b/reference_scripts/gOm8utR3HLQBT5hA.js new file mode 100644 index 0000000..d8929cd --- /dev/null +++ b/reference_scripts/gOm8utR3HLQBT5hA.js @@ -0,0 +1,6 @@ +let {value} = this.effect.getFlag("wfrp4e-soc", "m4result") || {}; + +if (value === 0) + args.actor.system.status.mood.value = 0; +else if (value !== undefined) + args.actor.system.status.mood.value += value; \ No newline at end of file diff --git a/reference_scripts/goz8yTlMozlsz3uY.js b/reference_scripts/goz8yTlMozlsz3uY.js new file mode 100644 index 0000000..b886e2e --- /dev/null +++ b/reference_scripts/goz8yTlMozlsz3uY.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Strength'; +const difficulty = 'easy'; +const target = 10; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/groEX1wJ9l00PkDF.js b/reference_scripts/groEX1wJ9l00PkDF.js new file mode 100644 index 0000000..ebf8cbe --- /dev/null +++ b/reference_scripts/groEX1wJ9l00PkDF.js @@ -0,0 +1,75 @@ +let turns = this.effect.getFlag("wfrp4e", "turns"); +if (turns <= 0) return; +turns--; + +const speaker = ChatMessage.getSpeaker({actor: this.actor}); +const targetId = this.effect.getFlag("wfrp4e", "target"); +const target = canvas.scene.tokens.get(targetId); + +if (turns > 0) { + this.effect.setFlag("wfrp4e", "turns", turns); + + return this.script.scriptMessage(`

${speaker.alias} continues wrapping itself around ${target.name}. It will be able to start crushin in ${turns} turns.

`); +} + +if (this.actor.items.find(i => i.type === "extendedTest" && i.name === this.effect.name)) { + this.script.scriptMessage(`

${speaker.alias} can resume crushing ${target.name} with the Extended Test.

`); + + return; +} + +const extendedTestData = { + name: this.effect.name, + type: "extendedTest", + img: this.effect.img, + system: { + SL: { + current: 0, + target: target.actor.system.status.wounds.value + }, + test: { + value: 'Strength' + }, + completion: { + value: "remove" + }, + difficulty: { + value: "challenging" + } + } +}; + +const extendedTests = await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); +const extendedTest = extendedTests[0]; + +this.script.scriptMessage(`

${speaker.alias} finished wrapping itself around ${target.name}. It can now begin crushing via the @UUID[${extendedTest.uuid}] Extended Test.

`); + +let effect = { + name: extendedTest.name, + icon: extendedTest.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: extendedTest.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.effects.find(e => e.id === id); + const speaker = ChatMessage.getSpeaker({actor: this.actor}); + const targetId = effect.getFlag("wfrp4e", "target"); + const target = canvas.scene.tokens.get(targetId); + this.script.scriptMessage(\`

${speaker.alias} crushed the ${target.name}. Boat shatters, reduced to a mass of flotsam.

\`); + await effect.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } +} + +await extendedTests[0].createEmbeddedDocuments("ActiveEffect", [effect]); \ No newline at end of file diff --git a/reference_scripts/gxuBeGHwjZ7WfPeu.js b/reference_scripts/gxuBeGHwjZ7WfPeu.js new file mode 100644 index 0000000..027009f --- /dev/null +++ b/reference_scripts/gxuBeGHwjZ7WfPeu.js @@ -0,0 +1,2 @@ +let specification = Number(this.item.specification.value) || 1; +args.fields.slBonus -= specification; \ No newline at end of file diff --git a/reference_scripts/hOgha3ir8K9TVphO.js b/reference_scripts/hOgha3ir8K9TVphO.js new file mode 100644 index 0000000..c573099 --- /dev/null +++ b/reference_scripts/hOgha3ir8K9TVphO.js @@ -0,0 +1 @@ +return args.characteristic !== "fel"; \ No newline at end of file diff --git a/reference_scripts/hSImyYjL0CENTvXf.js b/reference_scripts/hSImyYjL0CENTvXf.js new file mode 100644 index 0000000..3000ac8 --- /dev/null +++ b/reference_scripts/hSImyYjL0CENTvXf.js @@ -0,0 +1,23 @@ +let test = await this.actor.setupSkill("Endurance", {fields : {difficulty : "difficult", appendTitle : ` - ${this.effect.name}`}}); +await test.roll(); +if (test.failed) +{ + await this.actor.addCondition("blinded"); +} + +let msg = `` +let armour = args.actor.itemTypes.armour.filter(i => i.system.isMetal && i.system.isEquipped); +for(let item of armour) +{ + for(let key in item.system.AP) + { + let AP = item.system.AP[key] + let damage = Math.floor(AP / 2); + await item.system.damageItem(damage, [key]); + } + msg += `

${item.name} AP reduced by half

` +} +if (msg) +{ + this.script.scriptMessage(msg, {speaker : {alias : args.actor.name}}); +} \ No newline at end of file diff --git a/reference_scripts/hWWvkPbgIN3lxz1u.js b/reference_scripts/hWWvkPbgIN3lxz1u.js new file mode 100644 index 0000000..f135bff --- /dev/null +++ b/reference_scripts/hWWvkPbgIN3lxz1u.js @@ -0,0 +1 @@ +return args.item?.system?.attackType !== "melee"; \ No newline at end of file diff --git a/reference_scripts/hYNWp75ggWSTht55.js b/reference_scripts/hYNWp75ggWSTht55.js new file mode 100644 index 0000000..c867124 --- /dev/null +++ b/reference_scripts/hYNWp75ggWSTht55.js @@ -0,0 +1,7 @@ +if (args.test.result.hitloc.value != "head" && args.test.result.critical) +{ + game.wfrp4e.utility.sleep(200).then(() => { + this.script.scriptMessage("Can roll on the @Table[crithead]{Head Critical Hits} instead of the normal hit location") + + }) +} \ No newline at end of file diff --git a/reference_scripts/hj7tI212neKIu9dh.js b/reference_scripts/hj7tI212neKIu9dh.js new file mode 100644 index 0000000..c400384 --- /dev/null +++ b/reference_scripts/hj7tI212neKIu9dh.js @@ -0,0 +1 @@ +this.actor.system.status.ward.value = 7; \ No newline at end of file diff --git a/reference_scripts/ht7csu1KImHzpzL5.js b/reference_scripts/ht7csu1KImHzpzL5.js new file mode 100644 index 0000000..132862f --- /dev/null +++ b/reference_scripts/ht7csu1KImHzpzL5.js @@ -0,0 +1 @@ +return args.item?.actor?.type !== "vehicle" || args.item?.type !== "weapon" || !args.item.name.includes("Cannon"); \ No newline at end of file diff --git a/reference_scripts/huJcVpVn6Q7sQkFC.js b/reference_scripts/huJcVpVn6Q7sQkFC.js new file mode 100644 index 0000000..abfc1b0 --- /dev/null +++ b/reference_scripts/huJcVpVn6Q7sQkFC.js @@ -0,0 +1,2 @@ +if (args.actorsystem.details.move.sail.value > 0) + args.actor.system.details.move.sail.value -= 1; diff --git a/reference_scripts/iO2hCDwyQ7v4qrOI.js b/reference_scripts/iO2hCDwyQ7v4qrOI.js new file mode 100644 index 0000000..ac4be73 --- /dev/null +++ b/reference_scripts/iO2hCDwyQ7v4qrOI.js @@ -0,0 +1,10 @@ +if (args.test.options.staunchBleeding) { + if (args.test.result.roll <= game.settings.get("wfrp4e", "automaticSuccess") || args.test.result.roll <= args.test.target) { + let staunch = ~~args.test.result.SL + 1 + if (args.test.options.fieldDressing && args.test.result.reversed) + staunch = Math.min(1, Number(args.test.result.SL)) + 1 + args.test.result.other.push(`${this.actor.name} removed ${staunch} Bleeding conditions from the patient.`) + } + else if (this.actor.characteristics.int.bonus + args.test.result.SL < 0) + args.test.result.other.push(`The patient contracts a @UUID[Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg]{Minor Infection}.`) +} \ No newline at end of file diff --git a/reference_scripts/iqUvV1Vu81M3WyZ4.js b/reference_scripts/iqUvV1Vu81M3WyZ4.js new file mode 100644 index 0000000..3688a7d --- /dev/null +++ b/reference_scripts/iqUvV1Vu81M3WyZ4.js @@ -0,0 +1,4 @@ +let SL = Number(this.effect.sourceTest.result.SL); +for (let i=0; i${speaker.alias} is Immersed within a Sea Elemental and suffers from @UUID[Compendium.wfrp4e-core.journals.JournalEntry.NS3YGlJQxwTggjRX.JournalEntryPage.WCivInLZrqEtZzF4#drowning-and-suffocation]{Suffocation}

They may attempt to escape by freeing themselves from the @Condition[Entangled} Condition as if they were @UUID[Compendium.wfrp4e-core.journals.JournalEntry.NS3YGlJQxwTggjRX.JournalEntryPage.wmA76Q2zJJ9HrkvA#grappling]{Grappled} by the Sea Elemental, making an Opposed Strength Test against its Strength of 59.

`); \ No newline at end of file diff --git a/reference_scripts/k0AkkBLtE8oZhBwn.js b/reference_scripts/k0AkkBLtE8oZhBwn.js new file mode 100644 index 0000000..fcd0fbe --- /dev/null +++ b/reference_scripts/k0AkkBLtE8oZhBwn.js @@ -0,0 +1,6 @@ +if (isNaN(parseInt(this.item.system.specification.value))) { + let value = await ValueDialog.create("Armoured Value", "Enter the Armoured value"); + if (value) { + this.item.updateSource({"system.specification.value" : value}); + } +} \ No newline at end of file diff --git a/reference_scripts/kbXDGAmWWD4CZJHB.js b/reference_scripts/kbXDGAmWWD4CZJHB.js new file mode 100644 index 0000000..46569c0 --- /dev/null +++ b/reference_scripts/kbXDGAmWWD4CZJHB.js @@ -0,0 +1,5 @@ +const sin = this.effect.sourceActor.system.status.sin.value; +const roll = new Roll(`2d10 - ${sin}`); +await roll.evaluate(); +await roll.toMessage({flavor: `${this.effect.name}`}); +this.actor.system.status.mood.addEntry(`${this.effect.name} (${this.effect.sourceActor.name})`, roll.total); \ No newline at end of file diff --git a/reference_scripts/kvnZz8yqdTZbErkr.js b/reference_scripts/kvnZz8yqdTZbErkr.js new file mode 100644 index 0000000..e35746a --- /dev/null +++ b/reference_scripts/kvnZz8yqdTZbErkr.js @@ -0,0 +1,3 @@ +args.actor.system.details.move.value -= 2; +args.actor.system.details.man -= 1; +args.actor.system.status.carries.max *= 1.5; \ No newline at end of file diff --git a/reference_scripts/lOIHiAIDtj91kllN.js b/reference_scripts/lOIHiAIDtj91kllN.js new file mode 100644 index 0000000..35b81b2 --- /dev/null +++ b/reference_scripts/lOIHiAIDtj91kllN.js @@ -0,0 +1,6 @@ +const chanties = await WFRP_Utility.findAll('wfrp4e-soc.chanty'); +let choice = await ItemDialog.create(chanties, 1, "Choose Chanty"); +if (choice.length) { + console.log(choice); + this.actor.createEmbeddedDocuments("Item", choice, {fromEffect: this.effect.id}); +} \ No newline at end of file diff --git a/reference_scripts/lZuavewrJzOehrJQ.js b/reference_scripts/lZuavewrJzOehrJQ.js new file mode 100644 index 0000000..64118c4 --- /dev/null +++ b/reference_scripts/lZuavewrJzOehrJQ.js @@ -0,0 +1,14 @@ +let test = await this.actor.setupSkill('Endurance', { + appendTitle: ` – ${this.effect.name}`, + skipTargets: true, + fields: {difficulty: 'easy'}, + characteristic: 't', + context: {failure: "Mast shattered!"} +}); +await test.roll(); + +if (test.failed) { + let crit = await fromUuid("Item.d4bCnR1zINTNF9VC"); + await this.actor.createEmbeddedDocuments("Item", [crit]); + this.effect.update({disabled: true}); +} \ No newline at end of file diff --git a/reference_scripts/ljGX2w8hCTyLAjRp.js b/reference_scripts/ljGX2w8hCTyLAjRp.js new file mode 100644 index 0000000..2371ff4 --- /dev/null +++ b/reference_scripts/ljGX2w8hCTyLAjRp.js @@ -0,0 +1,2 @@ +let specification = Number(this.item.specification.value) || 1; +args.actor.system.details.price.gc -= Math.floor(args.actor.system.details.price.gc * 0.1 * specification); \ No newline at end of file diff --git a/reference_scripts/mGHKBkDp4omSaBlD.js b/reference_scripts/mGHKBkDp4omSaBlD.js new file mode 100644 index 0000000..36c1d60 --- /dev/null +++ b/reference_scripts/mGHKBkDp4omSaBlD.js @@ -0,0 +1,12 @@ +this.actor.getActiveTokens().forEach(t => t.document.update({light : { + "dim": 20, + "bright": 10, + "angle": 360, + "alpha": 0.4, + "animation": { + "speed": 3, + "intensity": 3, + "type": "torch", + }, + "color": "#ffcc66", + }})); \ No newline at end of file diff --git a/reference_scripts/mT7PDcjF3cJTDbjR.js b/reference_scripts/mT7PDcjF3cJTDbjR.js new file mode 100644 index 0000000..6995528 --- /dev/null +++ b/reference_scripts/mT7PDcjF3cJTDbjR.js @@ -0,0 +1,2 @@ +args.actor.system.details.move.value -= 1; +args.actor.system.status.carries.max *= 1.25; \ No newline at end of file diff --git a/reference_scripts/mXvtf3qhJjshpopX.js b/reference_scripts/mXvtf3qhJjshpopX.js new file mode 100644 index 0000000..53e2cdb --- /dev/null +++ b/reference_scripts/mXvtf3qhJjshpopX.js @@ -0,0 +1 @@ +return ["weapon", "cast", "channelling"].includes(args.type) \ No newline at end of file diff --git a/reference_scripts/mlulnXQo8XU8vKLD.js b/reference_scripts/mlulnXQo8XU8vKLD.js new file mode 100644 index 0000000..95f2044 --- /dev/null +++ b/reference_scripts/mlulnXQo8XU8vKLD.js @@ -0,0 +1,8 @@ +if (isNaN(parseInt(this.item.system.specification.value))) +{ + let value = await ValueDialog.create("Enter Grim value", this.effect.name); + if (value) + { + this.item.updateSource({"system.specification.value" : value}); + } +} \ No newline at end of file diff --git a/reference_scripts/nIOeK0BrtdZeZW8X.js b/reference_scripts/nIOeK0BrtdZeZW8X.js new file mode 100644 index 0000000..8e85711 --- /dev/null +++ b/reference_scripts/nIOeK0BrtdZeZW8X.js @@ -0,0 +1,17 @@ +console.log("SKILL", this) + +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {fields : {difficulty : "challenging"}, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); + +let rollD10 = await new Roll("1d10").roll() +rollD10.toMessage(this.script.getChatData()) + + +if (test.succeeded) +{ + //... +} +else if (test.failed) +{ + //... +} diff --git a/reference_scripts/nkSmu7v9WiAaK4vq.js b/reference_scripts/nkSmu7v9WiAaK4vq.js new file mode 100644 index 0000000..0043a12 --- /dev/null +++ b/reference_scripts/nkSmu7v9WiAaK4vq.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Tailor)'; +const difficulty = 'easy'; +const target = 20; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/nlQA0shW8FCXjY7u.js b/reference_scripts/nlQA0shW8FCXjY7u.js new file mode 100644 index 0000000..179770d --- /dev/null +++ b/reference_scripts/nlQA0shW8FCXjY7u.js @@ -0,0 +1 @@ +return args.type != "cast" || args.item.lore.value != "fire" \ No newline at end of file diff --git a/reference_scripts/pVSnn4Zw6y1EBDhv.js b/reference_scripts/pVSnn4Zw6y1EBDhv.js new file mode 100644 index 0000000..bbb77c7 --- /dev/null +++ b/reference_scripts/pVSnn4Zw6y1EBDhv.js @@ -0,0 +1,2 @@ +args.actor.system.details.man -= 1; +args.actor.system.details.move.value -= 1; \ No newline at end of file diff --git a/reference_scripts/pkKpxVqRHIzywerL.js b/reference_scripts/pkKpxVqRHIzywerL.js new file mode 100644 index 0000000..5ed3721 --- /dev/null +++ b/reference_scripts/pkKpxVqRHIzywerL.js @@ -0,0 +1,6 @@ +const ablaze = this.actor.hasCondition("ablaze"); + +if (ablaze) { + ablaze.delete(); + this.script.scriptNotification("Resisted Ablaze"); +} \ No newline at end of file diff --git a/reference_scripts/pvk5OhTNdVgwXoUa.js b/reference_scripts/pvk5OhTNdVgwXoUa.js new file mode 100644 index 0000000..29ff2f6 --- /dev/null +++ b/reference_scripts/pvk5OhTNdVgwXoUa.js @@ -0,0 +1 @@ +args.fields.successBonus += 2; \ No newline at end of file diff --git a/reference_scripts/q8lOAWr2970sZeTw.js b/reference_scripts/q8lOAWr2970sZeTw.js new file mode 100644 index 0000000..9ee1f34 --- /dev/null +++ b/reference_scripts/q8lOAWr2970sZeTw.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Carpentry)'; +const difficulty = 'challenging'; +const target = 20; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/qTcK1TSjLTi0jNQK.js b/reference_scripts/qTcK1TSjLTi0jNQK.js new file mode 100644 index 0000000..b894a45 --- /dev/null +++ b/reference_scripts/qTcK1TSjLTi0jNQK.js @@ -0,0 +1,8 @@ +let AP = args.actor.status.armour; + +AP["head"].value += 1; +AP["rArm"].value += 1; +AP["lArm"].value += 1; +AP["body"].value += 1; +AP["lLeg"].value += 1; +AP["rLeg"].value += 1; \ No newline at end of file diff --git a/reference_scripts/qnJu82zgnfOsnqZV.js b/reference_scripts/qnJu82zgnfOsnqZV.js new file mode 100644 index 0000000..5677b9a --- /dev/null +++ b/reference_scripts/qnJu82zgnfOsnqZV.js @@ -0,0 +1,12 @@ +let closed = !this.item.getFlag("wfrp4e-soc", "gunport") || false; + +await this.item.setFlag("wfrp4e-soc", "gunport", closed); +let scriptData = this.effect.flags.wfrp4e.scriptData; + +if (closed) { + scriptData[0].label = "Open"; +} else { + scriptData[0].label = "Close"; +} + +await this.effect.update({"flags.wfrp4e.scriptData": scriptData}); \ No newline at end of file diff --git a/reference_scripts/qzGPJflVW7c2Ciim.js b/reference_scripts/qzGPJflVW7c2Ciim.js new file mode 100644 index 0000000..cb29090 --- /dev/null +++ b/reference_scripts/qzGPJflVW7c2Ciim.js @@ -0,0 +1 @@ +return args.skill?.name !== game.i18n.localize("NAME.Cool"); \ No newline at end of file diff --git a/reference_scripts/rBAoyhzeU3Q8MVSk.js b/reference_scripts/rBAoyhzeU3Q8MVSk.js new file mode 100644 index 0000000..3dd08db --- /dev/null +++ b/reference_scripts/rBAoyhzeU3Q8MVSk.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Carpenter)'; +const difficulty = 'difficult'; +const target = 50; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/rVRDoxiWILo7d8FF.js b/reference_scripts/rVRDoxiWILo7d8FF.js new file mode 100644 index 0000000..a75ce6f --- /dev/null +++ b/reference_scripts/rVRDoxiWILo7d8FF.js @@ -0,0 +1,4 @@ +let specification = Number(this.item.specification.value) || 1; +args.actor.system.status.wounds.max += Math.floor(args.actor.system.status.wounds.max * 0.3 * specification); +args.actor.system.status.carries.max -= Math.floor(args.actor.system.status.carries.max * 0.1 * specification); +args.actor.system.details.price.gc += args.actor.system.details.price.gc * 0.2 * specification; \ No newline at end of file diff --git a/reference_scripts/rX8FTinyTMj9WJri.js b/reference_scripts/rX8FTinyTMj9WJri.js new file mode 100644 index 0000000..d0c393f --- /dev/null +++ b/reference_scripts/rX8FTinyTMj9WJri.js @@ -0,0 +1,37 @@ +if (!this.actor.flags.holed) return; +if (this.actor.flags.holed.applied === true) return; +if (this.actor.hasCondition("dead")) return; + +const currentHoled = this.actor.flags.holed.holed || 0; + +const openGunPorts = this.actor.itemTypes.vehicleMod.reduce((acc, m) => { + if (!m.name.toLowerCase().includes("gun port")) + return acc; + + let closed = m.getFlag("wfrp4e-soc", "gunport"); + if (!closed) acc++; + + return acc; +}, 0); + +const totalHoled = currentHoled + openGunPorts; +const toughness = this.actor.system.characteristics.t.value; +this.actor.flags.holed.total = totalHoled; + +if (totalHoled >= toughness) { + const speaker = ChatMessage.getSpeaker({actor: this.actor}); + this.script.scriptMessage(` +

${speaker.alias} sank due to having Holed (${totalHoled}) rating equal to, or exceeding its Toughness (${toughness })

+

+ Holed due to Critical Damage: ${currentHoled}
+ Holed due to opened Gun Ports: ${openGunPorts} +

+ `, { flavor: this.effect.name.split("(")[0]}); + this.actor.addCondition("dead"); +} else if (totalHoled >= (toughness * 0.5)) { + this.actor.system.details.move.value -= 1; + this.actor.system.details.man -= 1; + this.actor.flags.holed.half = true; +} + +this.actor.flags.holed.applied = true; \ No newline at end of file diff --git a/reference_scripts/rlTvhnDpj4lzfusf.js b/reference_scripts/rlTvhnDpj4lzfusf.js new file mode 100644 index 0000000..2a8b74f --- /dev/null +++ b/reference_scripts/rlTvhnDpj4lzfusf.js @@ -0,0 +1 @@ +return !args.skill?.name.includes(game.i18n.localize("NAME.Sail")) && args.skill?.name !== game.i18n.localize("NAME.Climb"); \ No newline at end of file diff --git a/reference_scripts/rly9iBUy8EX7NhQT.js b/reference_scripts/rly9iBUy8EX7NhQT.js new file mode 100644 index 0000000..c6e64e8 --- /dev/null +++ b/reference_scripts/rly9iBUy8EX7NhQT.js @@ -0,0 +1,27 @@ +if (game.user.targets.size !== 1) + return ui.notifications.warn("You must target exactly one Boat."); + +const target = game.user.targets.first(); +const vehicle = target.actor; + +if (!(vehicle.system instanceof VehicleModel)) + return ui.notifications.warn("You can only Constrict a Boat"); + +if (vehicle.size > 3) + return ui.notifications.warn("You can only Constrict vessels of Size Large or smaller"); + +const turns = Math.ceil(vehicle.system.details.length.value / 10); + +const mainEffect = this.item.effects.contents[0]; +const effectData = mainEffect.toObject(); + +effectData.statuses = [effectData.name.slugify()]; + +foundry.utils.setProperty(effectData, "flags.wfrp4e.target", target.id); +foundry.utils.setProperty(effectData, "flags.wfrp4e.turns", turns); + +await this.actor.applyEffect({effectData: [effectData]}); + +const speaker = ChatMessage.getSpeaker({actor: this.actor}); + +this.script.scriptMessage(`${speaker.alias} started wrapping itself around the ${target.name} and will be able to start crushing it after ${turns} turns.`); \ No newline at end of file diff --git a/reference_scripts/rqTT8yOyK4bUwbdm.js b/reference_scripts/rqTT8yOyK4bUwbdm.js new file mode 100644 index 0000000..024c9a6 --- /dev/null +++ b/reference_scripts/rqTT8yOyK4bUwbdm.js @@ -0,0 +1,15 @@ +let test = args.test +if (test.spell.lore.value == "fire") +{ + if (test.result.overcast.usage.target?.AoE) + { + test.result.overcast.usage.target.current += test.actor.characteristics.wp.bonus + test.result.overcast.usage.target.initial += test.actor.characteristics.wp.bonus + } + if (test.result.overcast.usage.range) + { + test.result.overcast.usage.range.current *= 2 + test.result.overcast.usage.range.initial *= 2 + } + +} \ No newline at end of file diff --git a/reference_scripts/sHVLKIdPbzLVItCa.js b/reference_scripts/sHVLKIdPbzLVItCa.js new file mode 100644 index 0000000..d0c491a --- /dev/null +++ b/reference_scripts/sHVLKIdPbzLVItCa.js @@ -0,0 +1,2 @@ +if (args.actorsystem.details.move.oars.value > 0) + args.actor.system.details.move.oars.value -= 1; \ No newline at end of file diff --git a/reference_scripts/sQDh3g11pWchxpW9.js b/reference_scripts/sQDh3g11pWchxpW9.js new file mode 100644 index 0000000..2a92563 --- /dev/null +++ b/reference_scripts/sQDh3g11pWchxpW9.js @@ -0,0 +1 @@ +return true \ No newline at end of file diff --git a/reference_scripts/tuIsytv3jl2yAIb2.js b/reference_scripts/tuIsytv3jl2yAIb2.js new file mode 100644 index 0000000..cf810e0 --- /dev/null +++ b/reference_scripts/tuIsytv3jl2yAIb2.js @@ -0,0 +1 @@ +return args.skill?.name !== game.i18n.localize("NAME.Charm") && args.skill?.name !== game.i18n.localize("NAME.Intimidate") && args.skill?.name !== game.i18n.localize("NAME.Leadership") \ No newline at end of file diff --git a/reference_scripts/uhCq5NwjQ2a2idPn.js b/reference_scripts/uhCq5NwjQ2a2idPn.js new file mode 100644 index 0000000..c8158a4 --- /dev/null +++ b/reference_scripts/uhCq5NwjQ2a2idPn.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Tailor)'; +const difficulty = 'easy'; +const target = 30; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/v18mmwUmuKiVfwzQ.js b/reference_scripts/v18mmwUmuKiVfwzQ.js new file mode 100644 index 0000000..518055f --- /dev/null +++ b/reference_scripts/v18mmwUmuKiVfwzQ.js @@ -0,0 +1,6 @@ +let test = await this.actor.setupTest(game.i18n.localize("NAME.Endurance"), {appendTitle : ` - ${this.effect.name}`, skipTargets: true}); +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("stunned"); +} \ No newline at end of file diff --git a/reference_scripts/vTebTUzXortx1Qut.js b/reference_scripts/vTebTUzXortx1Qut.js new file mode 100644 index 0000000..d65570d --- /dev/null +++ b/reference_scripts/vTebTUzXortx1Qut.js @@ -0,0 +1,4 @@ +let specification = Number(this.item.specification.value) || 1; +args.actor.system.characteristics.t.initial += 10 * specification; +args.actor.system.status.carries.max -= Math.floor(args.actor.system.status.carries.max * 0.1 * specification); +args.actor.system.details.price.gc += args.actor.system.details.price.gc * 0.1 * specification; \ No newline at end of file diff --git a/reference_scripts/vUpMQlbwDiYfMCNS.js b/reference_scripts/vUpMQlbwDiYfMCNS.js new file mode 100644 index 0000000..a1b5b3f --- /dev/null +++ b/reference_scripts/vUpMQlbwDiYfMCNS.js @@ -0,0 +1 @@ +this.actor.addCondition("ablaze"); \ No newline at end of file diff --git a/reference_scripts/w4RuGIfseGoxXA3k.js b/reference_scripts/w4RuGIfseGoxXA3k.js new file mode 100644 index 0000000..55abc51 --- /dev/null +++ b/reference_scripts/w4RuGIfseGoxXA3k.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Carpenter)'; +const difficulty = 'challenging'; +const target = 20; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/wRxgpGmlUpe7nwzJ.js b/reference_scripts/wRxgpGmlUpe7nwzJ.js new file mode 100644 index 0000000..45b97af --- /dev/null +++ b/reference_scripts/wRxgpGmlUpe7nwzJ.js @@ -0,0 +1,12 @@ +this.actor.getActiveTokens().forEach(t => t.document.update({light : { + "dim": 0, + "bright": 0, + "angle": 360, + "alpha": 0.5, + "animation": { + "speed": 0, + "intensity": 0, + "type": "none", + }, + "color": "", + }})); \ No newline at end of file diff --git a/reference_scripts/xVYVegD692CCv8Yl.js b/reference_scripts/xVYVegD692CCv8Yl.js new file mode 100644 index 0000000..91e8707 --- /dev/null +++ b/reference_scripts/xVYVegD692CCv8Yl.js @@ -0,0 +1,12 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields : {difficulty : "hard"}, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); + +let newFortune = Math.max(0, this.actor.status.fortune.value - 1) +this.actor.update({ "system.status.fortune.value": newFortune }); + +if (test.failed) +{ + let char = this.effect.sourceActor.characteristics; + let duration = Math.floor((char.wp.initial + char.wp.advances)/10) ; + this.script.scriptMessage("Fatethief has been applied for " + duration + " days"); +} \ No newline at end of file diff --git a/reference_scripts/xWPgIZOQLba5nZ23.js b/reference_scripts/xWPgIZOQLba5nZ23.js new file mode 100644 index 0000000..0023126 --- /dev/null +++ b/reference_scripts/xWPgIZOQLba5nZ23.js @@ -0,0 +1,14 @@ +let nbFatigue = 1 + Number(this.effect.sourceTest.result.SL); +this.actor.addCondition("fatigued", nbFatigue); + +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields : {difficulty : "hard"}, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); + +if (test.succeeded) +{ + this.script.scriptNotification(this.actor.name + "resisted !") +} +else if (test.failed) +{ + this.actor.addCondition("unconscious", 1); +} \ No newline at end of file diff --git a/reference_scripts/xihniGjgqOhuaKWc.js b/reference_scripts/xihniGjgqOhuaKWc.js new file mode 100644 index 0000000..b2990e6 --- /dev/null +++ b/reference_scripts/xihniGjgqOhuaKWc.js @@ -0,0 +1,9 @@ + + if (args.test.failed) + { + let applicableCharacteristics = ["ws", "bs", "s", "fel", "ag", "t", "dex"]; + if (applicableCharacteristics.includes(args.test.characteristicKey)) + { + this.actor.addCondition("stunned"); + } + } \ No newline at end of file diff --git a/reference_scripts/z14Tb2YKCjiE5ZTU.js b/reference_scripts/z14Tb2YKCjiE5ZTU.js new file mode 100644 index 0000000..927f0b6 --- /dev/null +++ b/reference_scripts/z14Tb2YKCjiE5ZTU.js @@ -0,0 +1,12 @@ +this.actor.getActiveTokens().forEach(t => t.document.update({light : { + "dim": 30, + "bright": 20, + "angle": 90, + "alpha": 0.6, + "animation": { + "speed": 3, + "intensity": 3, + "type": "torch", + }, + "color": "#ffcc66", + }})); \ No newline at end of file diff --git a/reference_scripts/zL7ECmBBMAqf5Esn.js b/reference_scripts/zL7ECmBBMAqf5Esn.js new file mode 100644 index 0000000..b205bb2 --- /dev/null +++ b/reference_scripts/zL7ECmBBMAqf5Esn.js @@ -0,0 +1,30 @@ +let hasMagazine = await Dialog.confirm({content: "

Does the vessel have a magazine or any other kind of store for blackpowder?

"}); + +if (!hasMagazine) return; + +let roll = new Roll("d10"); +await roll.evaluate(); +// await roll.toMessage(); +let anchor = roll.toAnchor(); + +let crits = []; + +for (let i = 0; i < roll.total; i++) { + let result = await WFRP_Tables.rollTable('crithull'); + let collection = game.packs.get(result.object.documentCollection) + + if (collection) + await collection.getDocuments() + + if (!collection) + collection = game.items; + + let item = collection.get(result.object.documentId) + if (item) + crits.push(item); +} + +const items = await this.actor.createEmbeddedDocuments("Item", crits); +const speaker = ChatMessage.getSpeaker({actor: this.actor}); +const uuids = items.map(i => `@UUID[${i.uuid}]`); +this.script.scriptMessage(`

${this.item.name} caused an additional ${anchor.outerHTML} Critical Hits to the Hull!

`) \ No newline at end of file diff --git a/reference_scripts/zXh8rgMxWoCLTxVd.js b/reference_scripts/zXh8rgMxWoCLTxVd.js new file mode 100644 index 0000000..6cb2243 --- /dev/null +++ b/reference_scripts/zXh8rgMxWoCLTxVd.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Sail'; +const difficulty = 'challenging'; +const target = 40; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/zdGAvfL7zJ7wpYxG.js b/reference_scripts/zdGAvfL7zJ7wpYxG.js new file mode 100644 index 0000000..8865d25 --- /dev/null +++ b/reference_scripts/zdGAvfL7zJ7wpYxG.js @@ -0,0 +1,53 @@ +const repaired_message = `

Finished repairing ${this.item.name}.

`; +const test = 'Trade (Carpenter)'; +const difficulty = 'easy'; +const target = 40; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Repair the ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/reference_scripts/zkc1gIPLj0VoAONT.js b/reference_scripts/zkc1gIPLj0VoAONT.js new file mode 100644 index 0000000..1a86fae --- /dev/null +++ b/reference_scripts/zkc1gIPLj0VoAONT.js @@ -0,0 +1,8 @@ +let AP = args.actor.status.armour; + +AP["head"].value += 2; +AP["rArm"].value += 2; +AP["lArm"].value += 2; +AP["body"].value += 2; +AP["lLeg"].value += 2; +AP["rLeg"].value += 2; \ No newline at end of file diff --git a/reference_scripts/ztIkD5Zt6ko9D4Ca.js b/reference_scripts/ztIkD5Zt6ko9D4Ca.js new file mode 100644 index 0000000..22d98fa --- /dev/null +++ b/reference_scripts/ztIkD5Zt6ko9D4Ca.js @@ -0,0 +1 @@ +args.fields.modifier -= 10 \ No newline at end of file diff --git a/scripts/2W9uMTT6iJhfQ044.js b/scripts/2W9uMTT6iJhfQ044.js index ab95121..d8fe017 100644 --- a/scripts/2W9uMTT6iJhfQ044.js +++ b/scripts/2W9uMTT6iJhfQ044.js @@ -6,13 +6,14 @@ if (!currentCareer) return let inCurrentCareer = currentCareer.system.skills.includes(skill); -if (existingSkill && inCurrentCareer) +let craftsmanAdded = this.actor.getFlag("wfrp4e", "craftsmanAdded") || {}; +if (existingSkill && inCurrentCareer && !craftsmanAdded[existingSkill.name]) { existingSkill.system.advances.costModifier = -5; } else { + craftsmanAdded[skill] = true; currentCareer.system.skills.push(skill); -} - - + setProperty(this.actor, "flags.wfrp4e.craftsmanAdded", craftsmanAdded) +} \ No newline at end of file diff --git a/scripts/HrOBAXsEX073ReKl.js b/scripts/HrOBAXsEX073ReKl.js index 04bf5c0..c40ea3e 100644 --- a/scripts/HrOBAXsEX073ReKl.js +++ b/scripts/HrOBAXsEX073ReKl.js @@ -6,13 +6,16 @@ if (!currentCareer) return let inCurrentCareer = currentCareer.system.skills.includes(skill); -if (existingSkill && inCurrentCareer) +let perfectPitchAdded = this.actor.getFlag("wfrp4e", "perfectPitchAdded") || {}; +if (existingSkill && inCurrentCareer && !perfectPitchAdded[existingSkill.name]) { existingSkill.system.advances.costModifier = -5; } else { + perfectPitchAdded[skill] = true; currentCareer.system.skills.push(skill); + setProperty(this.actor, "flags.wfrp4e.perfectPitchAdded", perfectPitchAdded) } diff --git a/scripts/IzoOmDywGLqLNljN.js b/scripts/IzoOmDywGLqLNljN.js new file mode 100644 index 0000000..120e53d --- /dev/null +++ b/scripts/IzoOmDywGLqLNljN.js @@ -0,0 +1,19 @@ +let skill = `Langue (Magick)` +let currentCareer = this.actor.system.currentCareer; +let existingSkill = this.actor.itemTypes.skill.find(i => i.name == skill); + +if (!currentCareer) return + + +let inCurrentCareer = currentCareer.system.skills.includes(skill); +let witchAdded = actor.getFlag("wfrp4e", "witchAdded") || {}; +if (existingSkill && inCurrentCareer && !witchAdded[existingSkill.name]) +{ + existingSkill.system.advances.costModifier = -5; +} +else +{ + witchAdded[skill] = true; + currentCareer.system.skills.push(skill); + setProperty(this.actor, "flags.wfrp4e.witchAdded", witchAdded) +} \ No newline at end of file diff --git a/scripts/OGX4BneaYAnV25TO.js b/scripts/OGX4BneaYAnV25TO.js index f7f1a66..cd24841 100644 --- a/scripts/OGX4BneaYAnV25TO.js +++ b/scripts/OGX4BneaYAnV25TO.js @@ -15,25 +15,25 @@ if (wounds.value > 0) { wounds.value = wounds.max } - message += `${this.actor.name} récupère ${regen} Blessures.` + message += `${this.actor.name} regagne ${regen} Blessures.` if (regen == 10) { - message += `
En plus, il guérit d'une Blessure Critique.` -B } + message += `
Et guéri une Blessure Critique.` + } } else if (regen >= 8) { - message += `${this.actor.name} résultat de ${regen} et récupère 1 Blessure.` + message += `${this.actor.name} a obtenu ${regen} et récupère 1 Blessure.` wounds.value += 1 if (regen == 10) { - message += `
En plus, il guérit d'une Blessure Critique.` + message += `
Et guéri une Blessure Critique.` } } else { - message += `${this.actor.name} Résultat de ${regen} - Aucun effet.` + message += `${this.actor.name} Résultat de régénération de ${regen} - Aucun effet.` } await this.actor.update({ "system.status.wounds": wounds }) diff --git a/scripts/SWIJjM2RCmzfr64u.js b/scripts/SWIJjM2RCmzfr64u.js index 5a07e2e..0db546e 100644 --- a/scripts/SWIJjM2RCmzfr64u.js +++ b/scripts/SWIJjM2RCmzfr64u.js @@ -1,6 +1,4 @@ -if (args.test.result.hitloc.result == "head") -{ - args.test.result.critModifier = args.test.result.critModifier ? args.test.result.critModifier + 40 : 40 - +if (args.test.result.hitloc.result == "head" && args.test.result.critical){ + args.test.result.critModifier = args.test.result.critModifier ? args.test.result.critModifier + 40 : 40 args.test.result.critical += ` (+${args.test.result.critModifier})` } diff --git a/scripts/Uvk1X7sEhvv77YkD.js b/scripts/Uvk1X7sEhvv77YkD.js new file mode 100644 index 0000000..ea8388a --- /dev/null +++ b/scripts/Uvk1X7sEhvv77YkD.js @@ -0,0 +1,5 @@ +if (!args.flags.distractingApplied) +{ + args.fields.modifier -= 20; + args.flags.distractingApplied = true; +} \ No newline at end of file diff --git a/scripts/mXvtf3qhJjshpopX.js b/scripts/mXvtf3qhJjshpopX.js new file mode 100644 index 0000000..53e2cdb --- /dev/null +++ b/scripts/mXvtf3qhJjshpopX.js @@ -0,0 +1 @@ +return ["weapon", "cast", "channelling"].includes(args.type) \ No newline at end of file diff --git a/scripts/zXh8rgMxWoCLTxVd.js b/scripts/zXh8rgMxWoCLTxVd.js new file mode 100644 index 0000000..a904726 --- /dev/null +++ b/scripts/zXh8rgMxWoCLTxVd.js @@ -0,0 +1,53 @@ +const repaired_message = `

Réparation finie de ${this.item.name}.

`; +const test = 'Voile'; +const difficulty = 'challenging'; +const target = 40; + +const extendedTestData = { + name: this.item.name, + type: "extendedTest", + img: this.item.img, + system: { + SL: { + current: 0, + target: target + }, + test: { + value: test + }, + completion: { + value: "remove" + }, + difficulty: { + value: difficulty + } + }, + effects: [ + { + name: `Réparer le ${this.item.name}`, + icon: this.item.img, + flags: { + wfrp4e: { + applicationData: { + type: "document", + documentType: "Item" + }, + scriptData: [ + { + label: this.item.name, + script: ` + let id = this.item.flags.wfrp4e.fromEffect; + let effect = this.actor.appliedEffects.find(e => e.id === id); + this.script.scriptMessage("${repaired_message}"); + await effect.item.delete(); + `, + trigger: "deleteEffect" + } + ] + } + } + } + ] +}; + +await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id}); diff --git a/tools/test01.lua b/tools/test01.lua deleted file mode 100644 index 480edc2..0000000 --- a/tools/test01.lua +++ /dev/null @@ -1,6 +0,0 @@ -let item1 = await fromUuid("Compendium.wfrp4e-core.items.Item.EO05HX7jql0g605A") -let item2 = await fromUuid("Compendium.wfrp4e-core.items.Item.Bvd2aZ0gQUXHfCTh") -let ids = await this.actor.createEmbeddedDocuments("Item", [item1, item2], {fromEffect : this.effect.id}) -console.log(ids) -this.actor.updateEmbeddedDocuments('Item', [ {_id: ids[0], `system.specification.value`: 16} ] ) -