设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2078|回复: 1
打印 上一主题 下一主题

[已经过期] 附魔脚本的符文属性写法翻译

[复制链接]

Lv2.观梦者

梦石
0
星屑
532
在线时间
238 小时
注册时间
2011-7-17
帖子
101
跳转到指定楼层
1
发表于 2014-11-17 22:27:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
这个附魔脚本的用法和呼出我已经明白了,但是他里面的符文属性写法还不太明白, 脚本上说的写法是这样的: [type, code, data_id, value 1, value2] => [name, description]
但是我按照他的写法没有作用  谷歌翻译还是不能完全看明白  求翻译下范例中第一个脚本的内容

附魔系统.rar

1.43 MB, 下载次数: 139

Lv2.观梦者

梦石
0
星屑
532
在线时间
238 小时
注册时间
2011-7-17
帖子
101
2
 楼主| 发表于 2014-11-17 22:28:13 | 只看该作者
  1. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2. #  ▼ Traits Namer
  3. #  Author: Kread-EX
  4. #  Version: 1.01
  5. #  Release date: 11/03/2012
  6. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

  7. #-------------------------------------------------------------------------------------------------
  8. #  ▼ UPDATES
  9. #-------------------------------------------------------------------------------------------------
  10. # # 24/03/2012. Added methods used by Alchemic Synthesis.
  11. # # 23/03/2012. Version 1.0, now help window generation is included.
  12. #-------------------------------------------------------------------------------------------------
  13. #  ▼ TERMS OF USAGE
  14. #-------------------------------------------------------------------------------------------------
  15. # #  You are free to adapt this work to suit your needs.
  16. # #  You can use this work for commercial purposes if you like it.
  17. # #  Credit is appreciated.
  18. # #
  19. # # For support:
  20. # # grimoirecastle.wordpress.com
  21. # # rpgmakerweb.com
  22. # # rpgrevolution.com
  23. #-------------------------------------------------------------------------------------------------
  24. #  ▼ INTRODUCTION
  25. #-------------------------------------------------------------------------------------------------
  26. # # This is a core script. By itself, it doesn't do anything but it used by
  27. # # Runic Enchantment and Alchemic Synthesis. The purpose of this script
  28. # # is to provide an automated way to name traits: the script retrieve the traits
  29. # # data and generates a name based on a customizable template.
  30. #-------------------------------------------------------------------------------------------------

  31. $imported = {} if $imported.nil?
  32. $imported['KRX-TraitsNamer'] = true

  33. puts 'Load: Traits Namer v1.01 by Kread-EX'

  34. module KRX
  35.   module TraitsNamer
  36. #===========================================================================
  37. # ■ CONFIGURATION
  38. #===========================================================================

  39.     X_PARAMETERS = [

  40.     'Accuracy',
  41.     'Evasion',
  42.     'Critical rate',
  43.     'M. Evasion',
  44.     'Counter rate',
  45.     'HP Regen',
  46.     'MP Regen',
  47.     'TP Regen'

  48.     ]

  49.     S_PARAMETERS = [

  50.     'Aggro effect',
  51.     'Guard effect',
  52.     'Recovery rate',
  53.     'Pharmacology',
  54.     'MP cost',
  55.     'TP charge rate',
  56.     'Physical damage',
  57.     'Magical damage',
  58.     'Floor damage',
  59.     'EXP rate'

  60.     ]

  61.     SPECIAL_FLAGS = [

  62.     'Autobattle',
  63.     'Guard',
  64.     'Cover',
  65.     'TP Saver'

  66.     ]

  67.     PARTY_ABILITY = [

  68.     'Half Encounter',
  69.     'No Encounter',
  70.     'No surprise attacks',
  71.     'No preemptive attacks',
  72.     'Gold x2',
  73.     'Item Drops x2'

  74.     ]

  75.     CODENAMES = {

  76.     11 => '%s resist: %d%%'       , # Element rate
  77.     12 => '%s debuff rate: %d%%'  , # Debuff rate
  78.     13 => '%s resist: %d%%'       , # State rate
  79.     14 => 'Immunity: %s'          , # State immunity
  80.     21 => '%s: %d%%'              , # Parameter rate
  81.     22 => '%s: %d%%'              , # Additional parameter rate
  82.     23 => '%s: %d%%'              , # Special parameter rate
  83.     31 => 'Attack %s'             , # Physical attack attribute
  84.     32 => 'Attack %s %d%%'        , # Physical attack state
  85.     33 => 'Attack speed %d'       , # Attack speed correction
  86.     34 => 'Attack x%d'            , # Additional attacks
  87.     41 => 'Command: %s'           , # Add skill type
  88.     42 => 'Seal: %s'              , # Seal skill type
  89.     43 => 'Skill: %s'             , # Add skill
  90.     44 => 'Skill Seal: %s'        , # Seal skill
  91.     51 => 'Can equip: %s'         , # Add equip type (weapon)
  92.     52 => 'Can equip: %s'         , # Add equip type (armor)
  93.     53 => 'Fix equip: %s'         , # Fix equip slot
  94.     54 => 'Seal equip: %s'        , # Seal equip slot
  95.     55 => 'Dual Wielding'         , # Dual Wield
  96.     61 => 'Bonus Actions: +%d%%'  , # Bonus actions
  97.     62 => '%s'                    , # Special flag
  98.     63 => 'Collapse type'         , # Collapse type (will never be used, I think)
  99.     64 => '%s'                    , # Party ability

  100.     }

  101.     CODEHELP = {

  102.     # Element rate
  103.     11 => 'Grants %d%% %s resistance.',
  104.     # Debuff rate
  105.     12 => 'Grants %d%% resistance to %s debuff.',
  106.     # State rate
  107.     13 => 'Grants %d%% %s resistance.',
  108.     # State immunity
  109.     14 => 'Grants immunity to %s.',
  110.     # Parameter rate
  111.     21 => 'Raises %s by %d%%.',
  112.     # Additional parameter rate
  113.     22 => 'Raises %s by %d%%.',
  114.     # Special parameter rate
  115.     23 => 'Grants a %d% modifier to %s.',
  116.     # Physical attack attribute
  117.     31 => 'Adds %s element to normal attacks.',
  118.     # Physical attack state
  119.     32 => 'Adds %s to normal attacks (%d%% accuracy).',
  120.     # Attack speed correction (bonus)
  121.     33 => ['Raises attack speed by %d.',
  122.     # Attack speed correction (malus)
  123.     'Reduces attack speed by %d.'],
  124.     # Additional attacks
  125.     34 => 'Grants %d additional attacks.',
  126.     # Add skill type
  127.     41 => 'Enables the %s battle command.',
  128.     # Seal skill type
  129.     42 => 'Seals the %s battle command.',
  130.     # Add skill
  131.     43 => 'Allows the use of the %s skill',
  132.     # Seal skill
  133.     44 => 'Seals the %s skill.',
  134.     # Add equip type (weapon)
  135.     51 => 'Allows %s to be equipped.',
  136.     # Add equip type (armor)
  137.     52 => 'Allows %s to be equipped.',
  138.     # Fix equip slot
  139.     53 => 'Fixes the %s equipment slot.',
  140.     # Seal equip slot
  141.     54 => 'Seals the %s equipment slot.',
  142.     # Dual Wield
  143.     55 => 'Allows to use two weapons as the same time.',
  144.     # Bonus actions
  145.     61 => 'Raises the action rate by %d%%.',
  146.     # Autobattle
  147.     62 => ['The character will act on his/her own in battle.',
  148.     # Guard
  149.     'The character will permanently defend.',
  150.     # Cover
  151.     'The character will take hits for his/her wounded comrades.',
  152.     # TP Saver
  153.     'TP are kept after battles.'],
  154.     # Collapse type (no need to use it but meh)
  155.     63 => 'Alters the collapse animation.',
  156.     # Half encounter
  157.     64 => ['Halves the random encounter rate.',
  158.     # No encounter
  159.     'Disables random encounters.',
  160.     # No surprise attacks
  161.     'Disables surprise attacks.',
  162.     # No preemptive attacks
  163.     'Disables preemptive attacks.',
  164.     # Gold x2
  165.     'Doubles the money obtained after a battle.',
  166.     # Item Drops x2
  167.     'Doubles the drop rate of items.']

  168.     }

  169.     EFFECTS_CODENAMES = {

  170.     11 => 'HP Recovery'                   , # HP Recovery
  171.     12 => 'MP Recovery'                   , # MP Recovery
  172.     13 => 'TP Recovery'                   , # TP Gain
  173.     21 => 'Add %s'                        , # Add State
  174.     22 => 'Cleanse %s'                    , # Remove State
  175.     31 => '%s+'                           , # Add buff
  176.     32 => '%s-'                           , # Add debuff
  177.     33 => 'Dispel %s+'                    , # Remove buff
  178.     34 => 'Cancel %s-'                    , # Remove debuff
  179.     41 => 'Escape'                        , # Escape
  180.     42 => '%s Bonus'                      , # Permanent stat growth
  181.     43 => 'Learn %s'                      , # Permanent skill learning
  182.     44 => 'Common Event'                  , # Common event

  183.     }

  184.     EFFECTS_CODEHELP = {

  185.     # HP Recovery (static)
  186.     11 => ['Restores %d HP.',
  187.     # HP Recovery (dynamic)
  188.     'Restores %d%% of maximum HP.'],
  189.     # MP Recovery (static)
  190.     12 => ['Restores %d MP.',
  191.     # MP Recovery (dynamic)
  192.     'Restores %d%% of maximum MP.'],
  193.     # TP Gain
  194.     13 => 'Restores %d%% TP.',
  195.     # Add State
  196.     21 => 'Inflicts %s (%d%% chance).',
  197.     # Remove State
  198.     22 => 'Cancels %s.',
  199.     # Add buff
  200.     31 => 'Increases %s for %d turns.',
  201.     # Add debuff
  202.     32 => 'Decreases %s for %d turns.',
  203.     # Remove buff
  204.     33 => 'Cancels a previously applied %s buff.',
  205.     # Remove debuff
  206.     34 => 'Dispels an active %s debuff.',
  207.     # Escape
  208.     41 => 'Automatically escape from battle.',
  209.     # Permanent stat growth
  210.     42 => 'Boosts %d by %d permanently.',
  211.     # Permanent skill learning
  212.     43 => 'Teaches the %s skill permanently.',
  213.     # Common Event
  214.     44 => 'Calls a common event.'

  215.     }

  216. #===========================================================================
  217. # ■ CUSTOM TRAITS/EFFECTS CONFIGURATION
  218. #===========================================================================

  219.     # INSTRUCTIONS
  220.     # Here you can define custom traits names and descriptions.
  221.     #
  222.     # Syntax:
  223.     # [type, code, data_id, value 1, value2] => [name, description]
  224.     #
  225.     # type: 0 (for equipment), 1 (for usables)
  226.     #
  227.     # code: the code number. Refer to default naming to know what is what.
  228.     #
  229.     # data_id: the number of the option you've choosen in the trait droplist.
  230.     #
  231.     # value1: what you typed in the first field where you can write numbers.
  232.     # For equipment this is the only one.
  233.     #
  234.     # value2: usable items only. What you typed in the second field.
  235.     #
  236.     # description: If you want to also use a custom description. If you only
  237.     # want the custom name, set this to nil.

  238.     CUSTOM_TRAITS = {

  239.     [0, 32, 2, 50] => ['Poisonous', nil],
  240.     [0, 32, 2, 100] => ['Venomous', nil],

  241.     [1, 11, 0, 0, 10] => ['HP Recovery XS', nil],
  242.     [1, 11, 0, 0, 25] => ['HP Recovery S', nil],
  243.     [1, 11, 0, 0, 50] => ['HP Recovery M', nil],
  244.     [1, 11, 0, 0, 75] => ['HP Recovery L', nil],
  245.     [1, 11, 0, 0, 100] => ['HP Recovery XL', 'Restores all HP!'],
  246.     [1, 12, 0, 0, 10] => ['MP Recovery XS', nil],
  247.     [1, 12, 0, 0, 25] => ['MP Recovery S', nil],
  248.     [1, 12, 0, 0, 50] => ['MP Recovery M', nil],
  249.     [1, 12, 0, 0, 75] => ['MP Recovery L', nil],
  250.     [1, 12, 0, 0, 100] => ['MP Recovery XL', 'Restores all MP!'],
  251.     [1, 13, 0, 2, 0] => ['TP Recovery XS', nil],
  252.     [1, 13, 0, 5, 0] => ['TP Recovery S', nil],
  253.     [1, 13, 0, 10, 0] => ['TP Recovery M', nil],
  254.     [1, 13, 0, 16, 0] => ['TP Recovery L', nil],
  255.     [1, 13, 0, 20, 0] => ['TP Recovery XL', nil],

  256.     }

  257. #===========================================================================
  258. # ■ CONFIGURATION ENDS HERE
  259. #===========================================================================
  260.     #--------------------------------------------------------------------------
  261.     # ● Generates traits name
  262.     #--------------------------------------------------------------------------
  263.     def self.feature_name(code, data_id, value)
  264.       custom = CUSTOM_TRAITS[[0, code, data_id, self.convert_value(code, value)]]
  265.       return custom[0] unless custom.nil? || custom[0].nil?
  266.       base_name = CODENAMES[code]
  267.       data_name = case code
  268.         when 11, 31
  269.           $data_system.elements[data_id]
  270.         when 12, 21
  271.           Vocab.param(data_id)
  272.         when 13, 14, 32
  273.           $data_states[data_id].name
  274.         when 22
  275.           X_PARAMETERS[data_id]
  276.         when 23
  277.           S_PARAMETERS[data_id]
  278.         when 41, 42
  279.           $data_system.skill_types[data_id]
  280.         when 43, 44
  281.           $data_skills[data_id].name
  282.         when 51
  283.           $data_system.weapon_types[data_id]
  284.         when 52
  285.           $data_system.armor_types[data_id]
  286.         when 53, 54
  287.           Vocab.etype(data_id)
  288.         when 62
  289.           SPECIAL_FLAGS[data_id]
  290.         when 64
  291.           PARTY_ABILITY[data_id]
  292.         end
  293.       final_value = case code
  294.         when 11, 13
  295.           100 - (value * 100)
  296.         when 33, 34
  297.           value
  298.         else
  299.           value * 100
  300.         end
  301.       if data_name.nil?
  302.         name = sprintf(base_name, final_value)
  303.       else
  304.         name = sprintf(base_name, data_name, final_value)
  305.       end
  306.       name
  307.     end
  308.     #--------------------------------------------------------------------------
  309.     # ● Generates traits description
  310.     #--------------------------------------------------------------------------
  311.     def self.feature_description(code, data_id, value)
  312.       custom = CUSTOM_TRAITS[[0, code, data_id, self.convert_value(code, value)]]
  313.       return custom[1] unless custom.nil? || custom[1].nil?
  314.       if CODEHELP[code].is_a?(Array)
  315.         base_help = CODEHELP[code][data_id]
  316.       else
  317.         base_help = CODEHELP[code]
  318.       end
  319.       data_name = case code
  320.         when 11, 31
  321.           $data_system.elements[data_id]
  322.         when 12, 21
  323.           Vocab.param(data_id)
  324.         when 13, 14, 32
  325.           $data_states[data_id].name
  326.         when 22
  327.           X_PARAMETERS[data_id]
  328.         when 23
  329.           S_PARAMETERS[data_id]
  330.         when 41, 42
  331.           $data_system.skill_types[data_id]
  332.         when 43, 44
  333.           $data_skills[data_id].name
  334.         when 51
  335.           $data_system.weapon_types[data_id]
  336.         when 52
  337.           $data_system.armor_types[data_id]
  338.         when 53, 54
  339.           Vocab.etype(data_id)
  340.         when 62
  341.           SPECIAL_FLAGS[data_id]
  342.         when 64
  343.           PARTY_ABILITY[data_id]
  344.         end
  345.       final_value = case code
  346.         when 11, 13
  347.           100 - (value * 100)
  348.         when 33, 34
  349.           value
  350.         else
  351.           value * 100
  352.         end
  353.       if data_name.nil?
  354.         name = sprintf(base_help, final_value)
  355.       else
  356.         name = sprintf(base_help, data_name, final_value)
  357.       end
  358.       name
  359.     end
  360.     #--------------------------------------------------------------------------
  361.     # ● Generates effects name
  362.     #--------------------------------------------------------------------------
  363.     def self.effect_name(code, data_id, value1, value2)
  364.       custom = CUSTOM_TRAITS[[1, code, data_id,
  365.       self.convert_value(code, value1, false),
  366.       self.convert_value(code, value2, false)]]
  367.       return custom[0] unless custom.nil? || custom[0].nil?
  368.       base_name = EFFECTS_CODENAMES[code]
  369.       data_name = case code
  370.         when 21, 22
  371.           $data_states[data_id].name
  372.         when 31, 32, 33, 34, 42
  373.           Vocab.param(data_id)
  374.         when 43
  375.           $data_skills[data_id]
  376.         end
  377.       if data_name.nil?
  378.         name = sprintf(base_name, value1, value2)
  379.       else
  380.         name = sprintf(base_name, data_name, value1, value2)
  381.       end
  382.       name
  383.     end
  384.     #--------------------------------------------------------------------------
  385.     # ● Generates effects description
  386.     #--------------------------------------------------------------------------
  387.     def self.effect_description(code, data_id, value1, value2)
  388.       custom = CUSTOM_TRAITS[[1, code, data_id,
  389.       self.convert_value(code, value1, false),
  390.       self.convert_value(code, value2, false)]]
  391.       return custom[1] unless custom.nil? || custom[1].nil?
  392.       if EFFECTS_CODEHELP[code].is_a?(Array)
  393.         base_help = value2 > 0 ? EFFECTS_CODEHELP[code][0] :
  394.         EFFECTS_CODEHELP[code][1]
  395.       else
  396.         base_help = EFFECTS_CODEHELP[code]
  397.       end
  398.       data_name = case code
  399.         when 21, 22
  400.           $data_states[data_id].name
  401.         when 31, 32, 33, 34, 42
  402.           Vocab.param(data_id)
  403.         when 43
  404.           $data_skills[data_id]
  405.         end
  406.       value1 = self.convert_value(code, value1, false)
  407.       value2 = self.convert_value(code, value2, false)
  408.       value1 = value2 if value1 == 0
  409.       if data_name.nil?
  410.         name = sprintf(base_help, value1, value2)
  411.       else
  412.         name = sprintf(base_help, data_name, value1, value2)
  413.       end
  414.       name
  415.     end
  416.     #--------------------------------------------------------------------------
  417.     # ● Converts the real value to the one entered in the editor
  418.     #--------------------------------------------------------------------------
  419.     def self.convert_value(code, value, feature = true)
  420.       if feature && [33, 34].include?(code)
  421.         return value.to_i
  422.       elsif feature && [21].include?(code)
  423.         return (value.to_f / 100)
  424.       elsif [11, 12].include?(code) && value <= 1
  425.         return (value.to_i * 100).to_i
  426.       elsif [21, 22].include?(code)
  427.         return (value * 100).to_i
  428.       else
  429.         value.to_i
  430.       end
  431.     end
  432.     #--------------------------------------------------------------------------
  433.     # ● Points towards either feature name or effect name
  434.     #--------------------------------------------------------------------------
  435.     def self.trait_name(trait)
  436.       if trait.is_a?(RPG::BaseItem::Feature)
  437.         return self.feature_name(trait.code, trait.data_id, trait.value)
  438.       end
  439.       self.effect_name(trait.code, trait.data_id, trait.value1, trait.value2)
  440.     end
  441.     #--------------------------------------------------------------------------
  442.     # ● Points towards either feature description or effect description
  443.     #--------------------------------------------------------------------------
  444.     def self.trait_description(trait)
  445.       if trait.is_a?(RPG::BaseItem::Feature)
  446.         return self.feature_description(trait.code, trait.data_id, trait.value)
  447.       end
  448.       self.effect_description(trait.code, trait.data_id, trait.value1,
  449.       trait.value2)
  450.     end
  451.   end
  452. end
复制代码

点评

这是第二个代码,里面有符文的写法,求翻译下  发表于 2014-11-17 22:29
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-15 05:50

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表