Skip to content

Commit

Permalink
1.1.0 特徴付きスキル一覧を取得するインターフェース公開
Browse files Browse the repository at this point in the history
  • Loading branch information
elleonard committed Oct 23, 2023
1 parent b4407ce commit e9a9138
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/codes/SkillWithTraits/DarkPlasma_SkillWithTraits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ function Game_Actor_SkillWithTraitsMixin(gameActor: Game_Actor) {
return _traitObjects.call(this).concat(this.traitObjectsBySkill());
};

gameActor.traitObjectsBySkill = function () {
gameActor.skillsWithTrait = function () {
return this._skills
.map(skillId => {
const skill = $dataSkills[skillId];
if (!skill.meta.traits) {
return undefined;
}
.map(skillId => $dataSkills[skillId])
.filter(skill => skill.meta.traits);
};

gameActor.traitObjectsBySkill = function () {
return this.skillsWithTrait()
.map(skill => {
const t = String(skill.meta.traits).split('/');
switch (t[0]) {
case 'actor':
Expand Down
1 change: 1 addition & 0 deletions src/codes/SkillWithTraits/SkillWithTraits.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference path="../../typings/rmmz.d.ts" />

declare interface Game_Actor {
skillsWithTrait(): MZ.Skill[];
traitObjectsBySkill(): {traits: MZ.Trait[]}[];
}
3 changes: 3 additions & 0 deletions src/codes/SkillWithTraits/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ DarkPlasma_SkillWithTraits:
year: 2023
license: MIT
histories:
- date: 2023/10/23
version: 1.1.0
description: '特徴付きスキル一覧を取得するインターフェース公開'
- date: 2023/10/14
version: 1.0.0
description: '公開'
Expand Down

0 comments on commit e9a9138

Please sign in to comment.