restrainhalation / cw-the-book-of-devil-excerpt

CardWirth シナリオ『悪魔の書』で提供される手動診断機能の再現を目指した Web アプリケーションです。
https://restrainhalation.github.io/cw-the-book-of-devil-excerpt/
MIT License
0 stars 0 forks source link

定数作成の方向性を整理する #3

Closed restrainhalation closed 4 months ago

restrainhalation commented 4 months ago

定数の取り扱いと管理方法を整理することが目的です。

restrainhalation commented 4 months ago

命名規則はどのようにするか

CardWirthPy Reboot 様を参考に、以下の英名を使用していくこととします。

能力 身体的/精神的
ability physical dexterity 器用度
agility 敏捷性
intelligence 知力
strength 筋力
vitality 生命力
mind 精神力
mental aggressive 温厚/好戦(平和性/好戦性)
cheerful 内気/陽気(内向性/社交性)
brave 臆病/勇敢(臆病性/勇猛性)
cautious 大胆/慎重(大胆性/慎重性)
trickish 正直/狡猾(正直性/狡猾性)
性別
sex male
female
年代
period child 子供
young 若者
adult 大人
old 老人

『素質』と『特性』に関しては、それぞれ専用の変数名を定義するのは避ける方針とします。 理由は以下の通りです。


『特徴』の実体は A or B or 未選択(どちらでもない) の3パターンに分けられるが、どのような型が妥当か

ID (Number) を用いての管理とします。

『特徴』の有無は、保有する特徴を示す Array または Set に、該当 ID があるかどうかで判断します。

const CHARACTERISTIC: Characteristic[] = [
  {
    id: 1,
    group: 1,
    name: '秀麗',
    physical: { agility: 0, dexterity: 0, intelligence: 0, mind: 0, strength: 0, vitality: -1 },
    mental: { aggressive: 0.0, brave: 0.0, cautious: 0.0, cheerful: 0.5, trickish: 0.0 },
  },

// ...

const myCharacteristic = [1] // ID: 1 の特徴『秀麗』を持っている

定数の方向性について整理できましたので、クローズします。