Created
October 24, 2009 06:09
-
-
Save yhara/217392 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'erb' | |
CLASSES = [ | |
["戦士", 18,7], | |
["メイジ",40,15], | |
["プリースト", 35,11], | |
["盗賊", 37,12 ], | |
["レンジャー", 37,11], | |
["パラディン", 24,10], | |
["魔法戦士", 35,10], | |
["混沌の戦士", 25,11], | |
["修行僧", 34,11 ], | |
["超能力者", 33,11 ], | |
["ハイ=メイジ", 40,15], | |
["観光客", 18,7 ], | |
["ものまね師", 30,10], | |
["魔獣使い", 25,10 ], | |
["スペルマスター", 48,18], | |
["アーチャー", 24,10 ], | |
["魔道具術師", 42,16], | |
["吟遊詩人", 33,13 ], | |
["赤魔道師", 34,11], | |
["剣術家", 18,7 ], | |
["練気術師", 34,11 ], | |
["青魔道師", 40,16], | |
["騎兵", 18,7 ], | |
["狂戦士", -1000,0], | |
["鍛冶師", 28,10 ], | |
["鏡使い", 33,11], | |
["忍者", 24,10 ], | |
["スナイパー", 24,10 ], | |
] | |
RACES = [ | |
["人間", 0], | |
["ハーフエルフ", 3], | |
["エルフ", 6], | |
["ホビット", 12], | |
["ノーム", 8], | |
["ドワーフ", 7], | |
["ハーフオーク", -3], | |
["ハーフトロル", -8], | |
["アンバライト", 5], | |
["ハイエルフ", 13], | |
["野蛮人", -10], | |
["ハーフオーガ", -5], | |
["半巨人", -8], | |
["半タイタン", 5], | |
["サイクロプス", -5], | |
["イーク", 4], | |
["クラッコン", 5], | |
["コボルド", -3], | |
["ニーベルング", 5], | |
["ダークエルフ", 10], | |
["ドラコニアン", 5], | |
["マインドフレア", 15], | |
["インプ", 2], | |
["ゴーレム", -5], | |
["骸骨", 0], | |
["ゾンビ", -5], | |
["吸血鬼", 8], | |
["幽霊", 15], | |
["妖精", 8], | |
["獣人", -2], | |
["エント", 2], | |
["アルコン", 12], | |
["バルログ", 12], | |
["ドゥナダン", 5], | |
["影フェアリー", 8], | |
["クター", 5], | |
["アンドロイド", -5], | |
] | |
CHARAS = [ | |
["ふつう", 0], | |
["ちからじまん", -5], | |
["きれもの", 8], | |
["しあわせもの", 2], | |
["すばしっこい", 2], | |
["いのちしらず", 5], | |
["コンバット", -3], | |
["なまけもの", -5], | |
["セクシーギャル", 5], | |
["ラッキーマン", 7], | |
["がまんづよい", -3], | |
["いかさま", 40], | |
] | |
def sufficient?(pow) | |
pow > 53 | |
end | |
def power(k1, k2, r, c) | |
k1 + k2*4 + r + c*1.8 | |
end | |
def powers(k1, k2, r) | |
CHARAS.map{|_, c| power(k1, k2, r, c)} | |
end | |
def judge(pow) | |
%{ | |
<span class='#{judged_css(pow)}'> | |
#{if sufficient?(pow) then "○" else "<span class='danger'>×</a>" end} | |
</span> | |
} | |
end | |
def judged_css(pow) | |
if sufficient?(pow) then 'sufficient' else 'insufficient' end | |
end | |
def summary(k1, k2, r) | |
pows = powers(k1, k2, r) | |
pows.pop # remove ikasama | |
case | |
when pows.all?{|pow| sufficient?(pow)} then judge(pows.first) | |
when pows.all?{|pow| not sufficient?(pow)} then judge(pows.first) | |
else "<span class='occasionally danger'>△</span>" | |
end | |
end | |
ERB.new(<<EOD).run | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" > | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> | |
<style type="text/css"> | |
td, th { | |
font-size: 80%; | |
} | |
td { | |
cursor: pointer; | |
} | |
th.class_name { | |
width: 1em; | |
} | |
.sufficient { | |
color: blue; | |
} | |
.occasionally { | |
color: orange; | |
} | |
.insufficient { | |
color: red; | |
} | |
.danger{ | |
font-weight: bold; | |
} | |
</style> | |
</head> | |
<h1>*破壊*の杖が問題なく使用できるキャラメイク</h1> | |
<p> | |
<a href='http://hengband.ninja-x.jp/'>~変愚蛮怒の紹介~</a>の | |
<a href='http://hengband.ninja-x.jp/murakami/tatakai.html'>戦略講座</a> | |
の「これだけあると嬉しい魔道具能力の値」を表にしたものです。 | |
</p> | |
<p> | |
「○」はどの性格でも大丈夫なもの、「×」はどの性格でも駄目なものです(いかさまを除く)。「△」は | |
性格によっては大丈夫なものです。マスをクリックすると詳細が出ます。 | |
</p> | |
<table> | |
<%# classes %> | |
<tr> | |
<th></th> | |
<% CLASSES.each do |klass, k1, k2| %> | |
<th class='class_name'><%= klass %></th> | |
<% end %> | |
</tr> | |
<% RACES.each do |race, r| %> | |
<tr> | |
<th><%= race %></th> | |
<%# powers %> | |
<% CLASSES.each do |klass, k1, k2| %> | |
<td class='power'> | |
<div class='summary'><%= summary(k1, k2, r) %></div> | |
<div class='more' style='display:none;'> | |
<% CHARAS.each do |chara, c| | |
pow = power(k1, k2, r, c) %> | |
<span class='<%= judged_css(pow) %>'> | |
<%= chara %>: <%= judge(pow) %>(<%= pow %>)<br> | |
</span> | |
<% end %> | |
</div> | |
</td> | |
<% end %> | |
</tr> | |
<% end %> | |
</table> | |
<script> | |
$(function(){ | |
$(".power").click(function(){ | |
$(this).children(".summary").toggle(); | |
$(this).children(".more").toggle(); | |
}); | |
}); | |
</script> | |
<p> | |
データは<a href='http://www.kmc.gr.jp/~henkma/heng/index.html'>変愚蛮怒スポイラー</a>によりました。 | |
(スナイパーはr3057のsrc/tables.cより) | |
</p> | |
<p> | |
<a href='../w/?Hengband'>back</a> | |
</p> | |
</html> | |
EOD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment