mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
40-step coloured lighting instead of previous 256 steps, reducing memory usage by half (size of array of 'int' > size of array of 'char'), kerning in bitmap fonts (interchar, spacing of unihan/hangul/kana), new jp/kr unihan font from chinese font as jp/kr language has slightly different glyph for certain han character
Former-commit-id: 5d88e02857e6d33d87421fb5a2a39b423c540e0f Former-commit-id: e4ea5a98bf738db1478fa91dbd4a43231c2354af
This commit is contained in:
2
.idea/codeStyleSettings.xml
generated
2
.idea/codeStyleSettings.xml
generated
@@ -25,7 +25,7 @@
|
|||||||
<option name="FOR_STATEMENT_WRAP" value="5" />
|
<option name="FOR_STATEMENT_WRAP" value="5" />
|
||||||
<option name="ARRAY_INITIALIZER_WRAP" value="5" />
|
<option name="ARRAY_INITIALIZER_WRAP" value="5" />
|
||||||
<option name="ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE" value="true" />
|
<option name="ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE" value="true" />
|
||||||
<option name="WRAP_ON_TYPING" value="1" />
|
<option name="WRAP_ON_TYPING" value="0" />
|
||||||
</codeStyleSettings>
|
</codeStyleSettings>
|
||||||
</value>
|
</value>
|
||||||
</option>
|
</option>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -147,7 +147,7 @@ HEARTS, CLUBS, DIAMONDS, SPADES: PLAYERS WHO SUIT MUDS
|
|||||||
- (Optional) SFX
|
- (Optional) SFX
|
||||||
|
|
||||||
* Size
|
* Size
|
||||||
- Regular sprite 'height': 40 px
|
- Regular sprite 'height' (hitbox height) : 40 px
|
||||||
- Apparent height may vary
|
- Apparent height may vary
|
||||||
|
|
||||||
|
|
||||||
@@ -160,6 +160,4 @@ HEARTS, CLUBS, DIAMONDS, SPADES: PLAYERS WHO SUIT MUDS
|
|||||||
|
|
||||||
* Colour: 4096 colours (12-bit 0x000 - 0xFFF)
|
* Colour: 4096 colours (12-bit 0x000 - 0xFFF)
|
||||||
|
|
||||||
* Height variation option (.85 - .90 - .95 - 1 - 1.05 - 1.10 - 1.15)
|
|
||||||
|
|
||||||
* Base mass: 60 kg
|
* Base mass: 60 kg
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
* Drawing
|
* Drawing
|
||||||
|
|
||||||
- Players can create their own décors (hang on wall), dresses.
|
- Players can create their own décors (hang on wall), dresses.
|
||||||
- Two looms (3-3-2 colour mode, 4096 colour mode)
|
- Two looms (216 colour mode, 4096 colour mode)
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,46 +1,46 @@
|
|||||||
"id";"name" ;"opacity";"strength";"fluid";"viscosity";"solid";"wall";"lumcolor";"drop";"fall";"friction"
|
"id";"name" ;"opacity";"strength";"fluid";"viscosity";"solid";"wall";"lumcolor";"drop";"fall";"friction"
|
||||||
# Friction: 0: frictionless, <16: slippery, 16: regular, >16: sticky
|
# Friction: 0: frictionless, <16: slippery, 16: regular, >16: sticky
|
||||||
"0";"TILE_AIR" ; "4"; "0"; "0"; "N/A"; "0"; "0"; "0"; "0"; "0";"16"
|
"0";"TILE_AIR" ; "1"; "0"; "0"; "N/A"; "0"; "0"; "0"; "0"; "0";"16"
|
||||||
"1";"TILE_STONE" ; "32"; "25"; "0"; "N/A"; "1"; "1"; "0"; "1"; "0";"16"
|
"1";"TILE_STONE" ; "5"; "25"; "0"; "N/A"; "1"; "1"; "0"; "1"; "0";"16"
|
||||||
"2";"TILE_DIRT" ; "32"; "6"; "0"; "N/A"; "1"; "1"; "0"; "2"; "0";"16"
|
"2";"TILE_DIRT" ; "5"; "6"; "0"; "N/A"; "1"; "1"; "0"; "2"; "0";"16"
|
||||||
"3";"TILE_GRASS" ; "32"; "6"; "0"; "N/A"; "1"; "1"; "0"; "2"; "0";"16"
|
"3";"TILE_GRASS" ; "5"; "6"; "0"; "N/A"; "1"; "1"; "0"; "2"; "0";"16"
|
||||||
"4";"TILE_PLANK_NORMAL" ; "32"; "12"; "0"; "N/A"; "1"; "1"; "0"; "4"; "0";"16"
|
"4";"TILE_PLANK_NORMAL" ; "5"; "12"; "0"; "N/A"; "1"; "1"; "0"; "4"; "0";"16"
|
||||||
"5";"TILE_PLANK_EBONY" ; "32"; "12"; "0"; "N/A"; "1"; "1"; "0"; "5"; "0";"16"
|
"5";"TILE_PLANK_EBONY" ; "5"; "12"; "0"; "N/A"; "1"; "1"; "0"; "5"; "0";"16"
|
||||||
"6";"TILE_PLANK_BIRCH" ; "32"; "12"; "0"; "N/A"; "1"; "1"; "0"; "6"; "0";"16"
|
"6";"TILE_PLANK_BIRCH" ; "5"; "12"; "0"; "N/A"; "1"; "1"; "0"; "6"; "0";"16"
|
||||||
"7";"TILE_PLANK_BLOODROSE" ; "32"; "12"; "0"; "N/A"; "1"; "1"; "0"; "7"; "0";"16"
|
"7";"TILE_PLANK_BLOODROSE" ; "5"; "12"; "0"; "N/A"; "1"; "1"; "0"; "7"; "0";"16"
|
||||||
"8";"TILE_TRUNK_NORMAL" ; "32"; "12"; "0"; "N/A"; "1"; "0"; "0"; "8"; "0";"16"
|
"8";"TILE_TRUNK_NORMAL" ; "5"; "12"; "0"; "N/A"; "1"; "0"; "0"; "8"; "0";"16"
|
||||||
"9";"TILE_TRUNK_EBONY" ; "32"; "12"; "0"; "N/A"; "1"; "0"; "0"; "9"; "0";"16"
|
"9";"TILE_TRUNK_EBONY" ; "5"; "12"; "0"; "N/A"; "1"; "0"; "0"; "9"; "0";"16"
|
||||||
"10";"TILE_TRUNK_BIRCH" ; "32"; "12"; "0"; "N/A"; "1"; "0"; "0"; "10"; "0";"16"
|
"10";"TILE_TRUNK_BIRCH" ; "5"; "12"; "0"; "N/A"; "1"; "0"; "0"; "10"; "0";"16"
|
||||||
"11";"TILE_TRUNK_BLOODROSE" ; "32"; "12"; "0"; "N/A"; "1"; "0"; "0"; "11"; "0";"16"
|
"11";"TILE_TRUNK_BLOODROSE" ; "5"; "12"; "0"; "N/A"; "1"; "0"; "0"; "11"; "0";"16"
|
||||||
"12";"TILE_STONE" ; "32"; "25"; "0"; "N/A"; "1"; "1"; "0"; "12"; "0";"16"
|
"12";"TILE_STONE" ; "5"; "25"; "0"; "N/A"; "1"; "1"; "0"; "12"; "0";"16"
|
||||||
"13";"TILE_SAND" ; "32"; "6"; "0"; "N/A"; "1"; "1"; "0"; "13"; "1";"16"
|
"13";"TILE_SAND" ; "5"; "6"; "0"; "N/A"; "1"; "1"; "0"; "13"; "1";"16"
|
||||||
"14";"TILE_GRAVEL" ; "32"; "6"; "0"; "N/A"; "1"; "0"; "0"; "14"; "1";"16"
|
"14";"TILE_GRAVEL" ; "5"; "6"; "0"; "N/A"; "1"; "0"; "0"; "14"; "1";"16"
|
||||||
|
|
||||||
"15";"TILE_ORE_MALACHITE" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "15"; "0";"16"
|
"15";"TILE_ORE_MALACHITE" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "15"; "0";"16"
|
||||||
"16";"TILE_ORE_HEMATITE" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "16"; "0";"16"
|
"16";"TILE_ORE_HEMATITE" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "16"; "0";"16"
|
||||||
"17";"TILE_ORE_NATURAL_GOLD" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "17"; "0";"16"
|
"17";"TILE_ORE_NATURAL_GOLD" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "17"; "0";"16"
|
||||||
"18";"TILE_ORE_NATURAL_SILVER" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "18"; "0";"16"
|
"18";"TILE_ORE_NATURAL_SILVER" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "18"; "0";"16"
|
||||||
"19";"TILE_ORE_RUTILE" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "19"; "0";"16"
|
"19";"TILE_ORE_RUTILE" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "19"; "0";"16"
|
||||||
"20";"TILE_ORE_AURICHALCUMITE" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "20"; "0";"16"
|
"20";"TILE_ORE_AURICHALCUMITE" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "20"; "0";"16"
|
||||||
"21";"TILE_GEM_RUBY" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "21"; "0";"16"
|
"21";"TILE_GEM_RUBY" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "21"; "0";"16"
|
||||||
"22";"TILE_GEM_EMERALD" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "22"; "0";"16"
|
"22";"TILE_GEM_EMERALD" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "22"; "0";"16"
|
||||||
"23";"TILE_GEM_SAPPHIRE" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "23"; "0";"16"
|
"23";"TILE_GEM_SAPPHIRE" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "23"; "0";"16"
|
||||||
"24";"TILE_GEM_TOPAZ" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "24"; "0";"16"
|
"24";"TILE_GEM_TOPAZ" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "24"; "0";"16"
|
||||||
"25";"TILE_GEM_DIAMOND" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "25"; "0";"16"
|
"25";"TILE_GEM_DIAMOND" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "25"; "0";"16"
|
||||||
"26";"TILE_GEM_AMETHYST" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "26"; "0";"16"
|
"26";"TILE_GEM_AMETHYST" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "26"; "0";"16"
|
||||||
|
|
||||||
"27";"TILE_SNOW" ; "32"; "6"; "0"; "N/A"; "1"; "1"; "0"; "27"; "0";"16"
|
"27";"TILE_SNOW" ; "5"; "6"; "0"; "N/A"; "1"; "1"; "0"; "27"; "0";"16"
|
||||||
"28";"TILE_ICE_FRAGILE" ; "8"; "1"; "0"; "N/A"; "1"; "0"; "0"; "28"; "0";"16"
|
"28";"TILE_ICE_FRAGILE" ; "2"; "1"; "0"; "N/A"; "1"; "0"; "0"; "28"; "0";"16"
|
||||||
"29";"TILE_ICE_NATURAL" ; "24"; "25"; "0"; "N/A"; "1"; "1"; "0"; "29"; "0"; "8"
|
"29";"TILE_ICE_NATURAL" ; "4"; "25"; "0"; "N/A"; "1"; "1"; "0"; "29"; "0"; "8"
|
||||||
"30";"TILE_ICE_CLEAR_MAGICAL" ; "32"; "25"; "0"; "N/A"; "1"; "1"; "855567"; "30"; "0"; "8"
|
"30";"TILE_ICE_CLEAR_MAGICAL" ; "5"; "25"; "0"; "N/A"; "1"; "1"; "4967"; "30"; "0"; "8"
|
||||||
# see scandinavian name set female of this tile id!
|
# see scandinavian name set female of this tile id!
|
||||||
"31";"TILE_PLATFORM_STONE" ; "2"; "0"; "0"; "N/A"; "0"; "0"; "0"; "31"; "0";"16"
|
"31";"TILE_PLATFORM_STONE" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "31"; "0";"16"
|
||||||
"32";"TILE_PLATFORM_WOODEN" ; "2"; "0"; "0"; "N/A"; "0"; "0"; "0"; "32"; "0";"16"
|
"32";"TILE_PLATFORM_WOODEN" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "32"; "0";"16"
|
||||||
"33";"TILE_PLATFORM_EBONY" ; "2"; "0"; "0"; "N/A"; "0"; "0"; "0"; "33"; "0";"16"
|
"33";"TILE_PLATFORM_EBONY" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "33"; "0";"16"
|
||||||
"34";"TILE_PLATFORM_BIRCH" ; "2"; "0"; "0"; "N/A"; "0"; "0"; "0"; "34"; "0";"16"
|
"34";"TILE_PLATFORM_BIRCH" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "34"; "0";"16"
|
||||||
"35";"TILE_PLATFORM_BLOODROSE" ; "2"; "0"; "0"; "N/A"; "0"; "0"; "0"; "35"; "0";"16"
|
"35";"TILE_PLATFORM_BLOODROSE" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "35"; "0";"16"
|
||||||
|
|
||||||
"36";"TILE_TORCH" ; "0"; "0"; "0"; "N/A"; "0"; "0";"16769997"; "36"; "0";"16"
|
"36";"TILE_TORCH" ; "0"; "0"; "0"; "N/A"; "0"; "0";"63680"; "36"; "0";"16"
|
||||||
|
|
||||||
"239";"TILE_WATER" ; "16"; "100"; "1"; "2"; "0"; "0";"15464447"; "239"; "0";"16"
|
"239";"TILE_WATER" ; "2"; "100"; "1"; "2"; "0"; "0";"59159"; "239"; "0";"16"
|
||||||
"255";"TILE_LAVA" ; "0"; "100"; "1"; "2"; "0"; "0"; "8397312"; "239"; "0";"16"
|
"255";"TILE_LAVA" ; "0"; "100"; "1"; "2"; "0"; "0";"48320"; "239"; "0";"16"
|
||||||
|
|||||||
|
Can't render this file because it contains an unexpected character in line 1 and column 12.
|
Binary file not shown.
Binary file not shown.
@@ -1,29 +1,29 @@
|
|||||||
せかい いち みんな の にんきもの
|
せかい いち みんなの にんきもの
|
||||||
それ は かのじょ の こと アシュリー
|
それは かのじょの こと アシュリー
|
||||||
ひとめ みれば だれもが ふりむく
|
ひとめ みれば だれもが ふりむく
|
||||||
あたりまえ アシュリーだもん
|
あたりまえ アシュリーだもん
|
||||||
|
|
||||||
せかいじゅう みんな が あこがれる
|
せかいじゅう みんなが あこがれる
|
||||||
それは かのじょ の こと アシュリー
|
それは かのじょの こと アシュリー
|
||||||
アシュリー さま の まほう は さいこう
|
アシュリー さまの まほうは さいこう
|
||||||
こんや も パーティーよ
|
こんやも パーティーよ
|
||||||
|
|
||||||
なわ ぶな ぬー わらい の じゅもん
|
なわ ぶな ぬー わらいの じゅもん
|
||||||
じお いら うん なん の じゅもん
|
じお いら うん なんの じゅもん
|
||||||
いお でぃ えむ おぼえ られない
|
いお でぃ えむ おぼえ られない
|
||||||
ああ いや たいくつ
|
あぁ いや たいくつ
|
||||||
|
|
||||||
せかいいち みんな の にんきもの
|
せかいいち みんなの にんきもの
|
||||||
それは かのじょ の こと アシュリー
|
それは かのじょの こと アシュリー
|
||||||
アシュリー さま の まほうは さいこう
|
アシュリー さまの まほうは さいこう
|
||||||
こわい もの なしよ
|
こわい もの なしよ
|
||||||
|
|
||||||
よぞら の うみ あまた の ほし
|
よぞらの うみ あまたの ほし
|
||||||
いつも ひとりきり
|
いつも ひとりきり
|
||||||
みんな と なかよく したい の
|
みんなと なかよく したいの
|
||||||
どうしたら いい の
|
どうしたら いいの
|
||||||
|
|
||||||
せかい いち みんな の にんきもの
|
せかい いち みんなの にんきもの
|
||||||
それは かのじょ の こと アシュリー
|
それは かのじょの こと アシュリー
|
||||||
アシュリー さま の まほうは さいこう
|
アシュリー さまの まほうは さいこう
|
||||||
こんや も パーティーよ
|
こんやも パーティーよ
|
||||||
|
|||||||
28
res/books/kana_test_2_kanji.txt
Normal file
28
res/books/kana_test_2_kanji.txt
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
まだ気付いていない 提示された疑問
|
||||||
|
いま境界線が消えてく
|
||||||
|
|
||||||
|
このデータとコードで定義された思考
|
||||||
|
もうひとつの「リアル」が生まれる
|
||||||
|
|
||||||
|
千里を超え飛ぶ光の束から
|
||||||
|
伝わる新しい自分の存在
|
||||||
|
|
||||||
|
Neo Identity ー 広がって行く
|
||||||
|
電網の意識と
|
||||||
|
不可思議な未来
|
||||||
|
|
||||||
|
(Neo Identity ー 幻)
|
||||||
|
|
||||||
|
その認識により存在し得る世界
|
||||||
|
すべてを消去したらどうなる?
|
||||||
|
|
||||||
|
千里を超え飛ぶ光の束から
|
||||||
|
伝わる新しい自分の存在
|
||||||
|
|
||||||
|
Neo Identity ー 広がって行く
|
||||||
|
電網の意識と
|
||||||
|
不可思議な未来
|
||||||
|
|
||||||
|
Neo Identity ー そびえ立つ幻
|
||||||
|
電網の意識と
|
||||||
|
不可思議な未来
|
||||||
29
res/books/kana_test_kanji.txt
Normal file
29
res/books/kana_test_kanji.txt
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
世界一みんなの人気者
|
||||||
|
それは彼女のこと アシュリー
|
||||||
|
一目見れば誰もが振り向く
|
||||||
|
当たり前アシュリーだもん
|
||||||
|
|
||||||
|
世界中みんなが憧れる
|
||||||
|
それは彼女のこと アシュリー
|
||||||
|
アシュリー様の魔法は最高
|
||||||
|
今夜もパーティよ
|
||||||
|
|
||||||
|
なわ ぶな ぬー 笑いの呪文
|
||||||
|
じお いら うん 何お呪文
|
||||||
|
いお でぃ えむ 覚えられない
|
||||||
|
あぁ いや 退屈
|
||||||
|
|
||||||
|
世界一みんなの人気者
|
||||||
|
それは彼女のこと アシュリー
|
||||||
|
アシュリー様の魔法は最高
|
||||||
|
怖いもの無しよ
|
||||||
|
|
||||||
|
夜空の海 数多の星
|
||||||
|
いつも一人きり
|
||||||
|
みんなと仲良くしたいの
|
||||||
|
どうしたらいいの
|
||||||
|
|
||||||
|
世界一みんなの人気者
|
||||||
|
それは彼女のこと アシュリー
|
||||||
|
アシュリー様の魔法は最高
|
||||||
|
今夜もパーティよ
|
||||||
2
res/books/kanji_test_3.txt
Normal file
2
res/books/kanji_test_3.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
貴社の記者が汽車で帰社しました。
|
||||||
|
きしゃの きしゃが きしゃで きしゃ しました。
|
||||||
24
res/books/kanji_test_4.txt
Normal file
24
res/books/kanji_test_4.txt
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
探し物はなんですか
|
||||||
|
見つけにくい物ですか
|
||||||
|
カバンの中も机の中も
|
||||||
|
探したけれど見つからないのに
|
||||||
|
|
||||||
|
まだまだ探すぎですか
|
||||||
|
それより僕と踊りませんか
|
||||||
|
夢の中へ夢の中へ
|
||||||
|
行ってみたいと思いませんか
|
||||||
|
|
||||||
|
休むことも許されず
|
||||||
|
笑うことわ止められて
|
||||||
|
這いずくばって這いずくばって
|
||||||
|
いったい何をさがしているのか
|
||||||
|
|
||||||
|
探すのをやめたとき
|
||||||
|
見つかることもよくある話で
|
||||||
|
踊りましょう 夢の中へ
|
||||||
|
行ってみたいと思いませんか
|
||||||
|
|
||||||
|
探し物はなんですか
|
||||||
|
まだまだ探すぎですか
|
||||||
|
夢の中へ夢の中へ
|
||||||
|
行ってみたいと思いませんか
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 605 KiB After Width: | Height: | Size: 673 KiB |
BIN
res/graphics/fonts/unifont_unihan_jp.png
Normal file
BIN
res/graphics/fonts/unifont_unihan_jp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 673 KiB |
@@ -257,6 +257,6 @@ CREDITS_POLYGLOT=Traduit par le Polyglot Projet.
|
|||||||
|
|
||||||
LANGUAGE_ENGLISH=Anglais
|
LANGUAGE_ENGLISH=Anglais
|
||||||
LANGUAGE_FRENCH=Français
|
LANGUAGE_FRENCH=Français
|
||||||
LANGUAGE_JAPANESE_KANA=Japonais
|
LANGUAGE_JAPANESE=Japonais
|
||||||
LANGUAGE_JAPANESE_KANA=Japonais (kana)
|
LANGUAGE_JAPANESE_KANA=Japonais (kana)
|
||||||
LANGUAGE_KOREAN=Coréen
|
LANGUAGE_KOREAN=Coréen
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ public class Col216 implements LimitedColours {
|
|||||||
private byte data;
|
private byte data;
|
||||||
private static int[] LOOKUP = {0x00, 0x33, 0x66, 0x99, 0xCC, 0xFF};
|
private static int[] LOOKUP = {0x00, 0x33, 0x66, 0x99, 0xCC, 0xFF};
|
||||||
|
|
||||||
|
public static final int MUL = 6;
|
||||||
|
public static final int MUL_2 = MUL * MUL;
|
||||||
|
public static final int MAX_STEP = MUL - 1;
|
||||||
|
public static final int COLOUR_DOMAIN_SIZE = MUL_2 * MUL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param data
|
* @param data
|
||||||
@@ -31,9 +36,9 @@ public class Col216 implements LimitedColours {
|
|||||||
@Override
|
@Override
|
||||||
public Color createSlickColor(int raw) {
|
public Color createSlickColor(int raw) {
|
||||||
assertRaw(raw);
|
assertRaw(raw);
|
||||||
int r = LOOKUP[(raw / 36)];
|
int r = raw / MUL_2;
|
||||||
int g = LOOKUP[((raw % 36) / 6)];
|
int g = (raw % MUL_2) / MUL;
|
||||||
int b = LOOKUP[raw % 6];
|
int b = raw % MUL;
|
||||||
|
|
||||||
return createSlickColor(r, g, b);
|
return createSlickColor(r, g, b);
|
||||||
}
|
}
|
||||||
@@ -53,20 +58,20 @@ public class Col216 implements LimitedColours {
|
|||||||
@Override
|
@Override
|
||||||
public void create(int r, int g, int b) {
|
public void create(int r, int g, int b) {
|
||||||
assertRGB(r, g, b);
|
assertRGB(r, g, b);
|
||||||
data = (byte) (36 * r + 6 * g + b);
|
data = (byte) (MUL_2 * r + MUL * g + b);
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte getRaw() { return data; }
|
public byte getRaw() { return data; }
|
||||||
|
|
||||||
private void assertRaw(int i) {
|
private void assertRaw(int i) {
|
||||||
if (i > 0xFF || i < 0) {
|
if (i >= COLOUR_DOMAIN_SIZE || i < 0) {
|
||||||
System.out.println("i: " + String.valueOf(i));
|
System.out.println("i: " + String.valueOf(i));
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertRGB(int r, int g, int b) {
|
private void assertRGB(int r, int g, int b) {
|
||||||
if (r > 5 || g > 5 || b > 5 || r < 0 || g < 0 || b < 0) {
|
if (r > MAX_STEP || g > MAX_STEP || b > MAX_STEP || r < 0 || g < 0 || b < 0) {
|
||||||
System.out.println("r: " + String.valueOf(r));
|
System.out.println("r: " + String.valueOf(r));
|
||||||
System.out.println("g: " + String.valueOf(g));
|
System.out.println("g: " + String.valueOf(g));
|
||||||
System.out.println("b: " + String.valueOf(b));
|
System.out.println("b: " + String.valueOf(b));
|
||||||
|
|||||||
64
src/com/Torvald/ColourUtil/Col40.java
Normal file
64
src/com/Torvald/ColourUtil/Col40.java
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
package com.Torvald.ColourUtil;
|
||||||
|
|
||||||
|
import org.newdawn.slick.Color;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by minjaesong on 16-02-20.
|
||||||
|
*/
|
||||||
|
public class Col40 implements LimitedColours {
|
||||||
|
|
||||||
|
private char data;
|
||||||
|
private static int[] LOOKUP = {0,7,13,20,26,33,39,46,52,59,65,72,78,85,92,98,105,111,118,124
|
||||||
|
,131,137,144,150,157,163,170,177,183,190,196,203,209,216,222,229,235,242,248,255};
|
||||||
|
|
||||||
|
public static final int MUL = 40;
|
||||||
|
public static final int MUL_2 = MUL * MUL;
|
||||||
|
public static final int MAX_STEP = MUL - 1;
|
||||||
|
public static final int COLOUR_DOMAIN_SIZE = MUL_2 * MUL;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Color createSlickColor(int raw) {
|
||||||
|
assertRaw(raw);
|
||||||
|
int r = raw / MUL_2;
|
||||||
|
int g = (raw % MUL_2) / MUL;
|
||||||
|
int b = raw % MUL;
|
||||||
|
|
||||||
|
return createSlickColor(r, g, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Color createSlickColor(int r, int g, int b) {
|
||||||
|
assertRGB(r, g, b);
|
||||||
|
return new Color((LOOKUP[r] << 16) | (LOOKUP[g] << 8) | LOOKUP[b]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void create(int raw) {
|
||||||
|
assertRaw(raw);
|
||||||
|
data = (char) raw;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void create(int r, int g, int b) {
|
||||||
|
assertRGB(r, g, b);
|
||||||
|
data = (char) (MUL_2 * r + MUL * g + b);
|
||||||
|
}
|
||||||
|
|
||||||
|
public char getRaw() { return data; }
|
||||||
|
|
||||||
|
private void assertRaw(int i) {
|
||||||
|
if (i >= COLOUR_DOMAIN_SIZE || i < 0) {
|
||||||
|
System.out.println("i: " + String.valueOf(i));
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void assertRGB(int r, int g, int b) {
|
||||||
|
if (r > MAX_STEP || g > MAX_STEP || b > MAX_STEP || r < 0 || g < 0 || b < 0) {
|
||||||
|
System.out.println("r: " + String.valueOf(r));
|
||||||
|
System.out.println("g: " + String.valueOf(g));
|
||||||
|
System.out.println("b: " + String.valueOf(b));
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,7 +26,6 @@ public class GameFontBase implements Font {
|
|||||||
|
|
||||||
static final int W_CJK = 10;
|
static final int W_CJK = 10;
|
||||||
static final int W_UNIHAN = 16;
|
static final int W_UNIHAN = 16;
|
||||||
static final int W_CJK_DRAW = 11;
|
|
||||||
static final int W_LATIN_WIDE = 9; // width of regular letters, including m
|
static final int W_LATIN_WIDE = 9; // width of regular letters, including m
|
||||||
static final int W_LATIN_NARROW = 5; // width of letter f, t, i, l
|
static final int W_LATIN_NARROW = 5; // width of letter f, t, i, l
|
||||||
static final int H = 20;
|
static final int H = 20;
|
||||||
@@ -81,6 +80,8 @@ public class GameFontBase implements Font {
|
|||||||
,'ᛂ','᛬','᛫','᛭','ᛮ','ᛯ','ᛰ'
|
,'ᛂ','᛬','᛫','᛭','ᛮ','ᛯ','ᛰ'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int interchar = 0;
|
||||||
|
|
||||||
|
|
||||||
public GameFontBase() throws SlickException {
|
public GameFontBase() throws SlickException {
|
||||||
|
|
||||||
@@ -201,24 +202,44 @@ public class GameFontBase implements Font {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getWidth(String s) {
|
public int getWidth(String s) {
|
||||||
int len = 0;
|
return getWidthSubstr(s, s.length());
|
||||||
for (int i = 0; i < s.length(); i++) {
|
}
|
||||||
char c = s.charAt(i);
|
|
||||||
|
|
||||||
switch (getSheetType(c)) {
|
private int getWidthSubstr(String s, int endIndex) {
|
||||||
case SHEET_ASCII_EF:
|
int len = 0;
|
||||||
len += W_LATIN_NARROW; break;
|
for (int i = 0; i < endIndex; i++) {
|
||||||
case SHEET_KANA: case SHEET_CJK_PUNCT:
|
int c = getSheetType(s.charAt(i));
|
||||||
len += W_CJK_DRAW; break;
|
|
||||||
case SHEET_HANGUL:
|
if (i > 0 && s.charAt(i) > 0x20) { // Kerning
|
||||||
len += W_CJK_DRAW;
|
int cpre = getSheetType(s.charAt(i - 1));
|
||||||
break;
|
if (
|
||||||
case SHEET_UNIHAN:
|
((cpre == SHEET_UNIHAN || cpre == SHEET_HANGUL)
|
||||||
len += W_UNIHAN; break;
|
&& !(c == SHEET_UNIHAN || c == SHEET_HANGUL))
|
||||||
default:
|
|
||||||
len += W_LATIN_WIDE;
|
|| ((c == SHEET_UNIHAN || c == SHEET_HANGUL)
|
||||||
|
&& !(cpre == SHEET_UNIHAN || cpre == SHEET_HANGUL))
|
||||||
|
) {
|
||||||
|
// margin after/before hangul/unihan
|
||||||
|
len += 2;
|
||||||
|
}
|
||||||
|
else if ((c == SHEET_HANGUL || c == SHEET_KANA)
|
||||||
|
&& (cpre == SHEET_HANGUL || cpre == SHEET_KANA)) {
|
||||||
|
// margin between hangul/kana
|
||||||
|
len += 1;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (c == SHEET_ASCII_EF || c == SHEET_EXTA_EF || c == SHEET_CYRILIC_EF)
|
||||||
|
len += W_LATIN_NARROW;
|
||||||
|
else if (c == SHEET_KANA || c == SHEET_HANGUL || c == SHEET_CJK_PUNCT)
|
||||||
|
len += W_CJK;
|
||||||
|
else if (c == SHEET_UNIHAN)
|
||||||
|
len += W_UNIHAN;
|
||||||
|
else
|
||||||
|
len += W_LATIN_WIDE;
|
||||||
|
|
||||||
|
if (i < endIndex - 1) len += interchar;
|
||||||
}
|
}
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
@@ -247,9 +268,10 @@ public class GameFontBase implements Font {
|
|||||||
|
|
||||||
if (isHangul(ch)) {
|
if (isHangul(ch)) {
|
||||||
int[] hanPos = getHan(ch - 0xAC00);
|
int[] hanPos = getHan(ch - 0xAC00);
|
||||||
|
int glyphW = getWidth("" + ch);
|
||||||
hangulSheet.renderInUse(
|
hangulSheet.renderInUse(
|
||||||
Math.round(x
|
Math.round(x
|
||||||
+ getWidth(s.substring(0, i))
|
+ getWidthSubstr(s, i + 1) - glyphW
|
||||||
)
|
)
|
||||||
, Math.round((H - H_HANGUL) / 2 + y + 1)
|
, Math.round((H - H_HANGUL) / 2 + y + 1)
|
||||||
, hanPos[0]
|
, hanPos[0]
|
||||||
@@ -265,9 +287,10 @@ public class GameFontBase implements Font {
|
|||||||
char ch = s.charAt(i);
|
char ch = s.charAt(i);
|
||||||
|
|
||||||
if (isUniHan(ch)) {
|
if (isUniHan(ch)) {
|
||||||
|
int glyphW = getWidth("" + ch);
|
||||||
uniHan.renderInUse(
|
uniHan.renderInUse(
|
||||||
Math.round(x
|
Math.round(x
|
||||||
+ getWidth(s.substring(0, i))
|
+ getWidthSubstr(s, i + 1) - glyphW
|
||||||
)
|
)
|
||||||
, Math.round((H - H_HANGUL) / 2 + y)
|
, Math.round((H - H_HANGUL) / 2 + y)
|
||||||
, uniHanIndexX(ch)
|
, uniHanIndexX(ch)
|
||||||
@@ -334,10 +357,11 @@ public class GameFontBase implements Font {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
int glyphW = getWidth("" + ch);
|
||||||
sheetKey[prevInstance].renderInUse(
|
sheetKey[prevInstance].renderInUse(
|
||||||
Math.round(x + getWidth(s.substring(0, i)))
|
Math.round(x + getWidthSubstr(s, i + 1) - glyphW)
|
||||||
// pull punct right next to hangul to the left
|
// Interchar: pull punct right next to hangul to the left
|
||||||
+ ((i > 0 && isHangul(s.charAt(i - 1))) ? -2 : 0)
|
+ ((i > 0 && isHangul(s.charAt(i - 1))) ? -3 : 0)
|
||||||
, Math.round(y)
|
, Math.round(y)
|
||||||
- ((prevInstance == SHEET_CJK_PUNCT) ? 1 : 0)
|
- ((prevInstance == SHEET_CJK_PUNCT) ? 1 : 0)
|
||||||
, sheetX
|
, sheetX
|
||||||
@@ -384,4 +408,15 @@ public class GameFontBase implements Font {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void reloadUnihan() throws SlickException {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set margin between characters
|
||||||
|
* @param margin
|
||||||
|
*/
|
||||||
|
public void setInterchar(int margin) {
|
||||||
|
interchar = margin;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.Torvald.ImageFont;
|
package com.Torvald.ImageFont;
|
||||||
|
|
||||||
|
import com.Torvald.Terrarum.Terrarum;
|
||||||
import org.newdawn.slick.*;
|
import org.newdawn.slick.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -43,7 +44,10 @@ public class GameFontWhite extends GameFontBase {
|
|||||||
, W_CJK, H_KANA
|
, W_CJK, H_KANA
|
||||||
);
|
);
|
||||||
uniHan = new SpriteSheet(
|
uniHan = new SpriteSheet(
|
||||||
"./res/graphics/fonts/unifont_unihan.png"
|
"./res/graphics/fonts/unifont_unihan"
|
||||||
|
+ (((Terrarum.gameLocale.contains("jp") || Terrarum.gameLocale.contains("ko")))
|
||||||
|
? "_jp" : "")
|
||||||
|
+".png"
|
||||||
, W_UNIHAN, H_UNIHAN
|
, W_UNIHAN, H_UNIHAN
|
||||||
);
|
);
|
||||||
cyrilic = new SpriteSheet(
|
cyrilic = new SpriteSheet(
|
||||||
@@ -71,4 +75,14 @@ public class GameFontWhite extends GameFontBase {
|
|||||||
sheetKey = shk;
|
sheetKey = shk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reloadUnihan() throws SlickException {
|
||||||
|
uniHan = new SpriteSheet(
|
||||||
|
"./res/graphics/fonts/unifont_unihan"
|
||||||
|
+ ((!Terrarum.gameLocale.contains("cn"))
|
||||||
|
? "_jp" : "")
|
||||||
|
+".png"
|
||||||
|
, W_UNIHAN, H_UNIHAN
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ HEARTS, CLUBS, DIAMONDS, SPADES: PLAYERS WHO SUIT MUDS
|
|||||||
- (Optional) SFX
|
- (Optional) SFX
|
||||||
|
|
||||||
* Size
|
* Size
|
||||||
- Regular sprite 'height': 40 px
|
- Regular sprite 'height' (hitbox height) : 40 px
|
||||||
- Apparent height may vary
|
- Apparent height may vary
|
||||||
|
|
||||||
|
|
||||||
@@ -160,6 +160,4 @@ HEARTS, CLUBS, DIAMONDS, SPADES: PLAYERS WHO SUIT MUDS
|
|||||||
|
|
||||||
* Colour: 4096 colours (12-bit 0x000 - 0xFFF)
|
* Colour: 4096 colours (12-bit 0x000 - 0xFFF)
|
||||||
|
|
||||||
* Height variation option (.85 - .90 - .95 - 1 - 1.05 - 1.10 - 1.15)
|
|
||||||
|
|
||||||
* Base mass: 60 kg
|
* Base mass: 60 kg
|
||||||
|
|||||||
16
src/com/Torvald/Terrarum/Actors/Landholder.java
Normal file
16
src/com/Torvald/Terrarum/Actors/Landholder.java
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
package com.Torvald.Terrarum.Actors;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by minjaesong on 16-02-20.
|
||||||
|
*/
|
||||||
|
public interface Landholder {
|
||||||
|
|
||||||
|
ArrayList<Integer> getHouseDesignation();
|
||||||
|
void setHouseDesignation(ArrayList<Integer> list);
|
||||||
|
void addHouseTile(int x, int y);
|
||||||
|
void removeHouseTile(int x, int y);
|
||||||
|
void clearHouseDesignation();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ package com.Torvald.Terrarum.Actors;
|
|||||||
*/
|
*/
|
||||||
public interface Luminous {
|
public interface Luminous {
|
||||||
|
|
||||||
void setLuminance(int RGB);
|
void setLuminance(char RGB);
|
||||||
int getLuminance();
|
char getLuminance();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,15 +2,17 @@ package com.Torvald.Terrarum.Actors;
|
|||||||
|
|
||||||
import com.Torvald.Terrarum.Actors.Faction.Faction;
|
import com.Torvald.Terrarum.Actors.Faction.Faction;
|
||||||
import com.Torvald.Terrarum.GameItem.InventoryItem;
|
import com.Torvald.Terrarum.GameItem.InventoryItem;
|
||||||
|
import com.Torvald.Terrarum.Terrarum;
|
||||||
import org.newdawn.slick.GameContainer;
|
import org.newdawn.slick.GameContainer;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by minjaesong on 16-01-31.
|
* Created by minjaesong on 16-01-31.
|
||||||
*/
|
*/
|
||||||
public class TestNPC extends ActorWithBody implements AIControlled, Pocketed, CanBeStoredAsItem,
|
public class NPCIntelligentBase extends ActorWithBody implements AIControlled, Pocketed, CanBeStoredAsItem,
|
||||||
Factionable {
|
Factionable, Landholder {
|
||||||
|
|
||||||
private InventoryItem itemData;
|
private InventoryItem itemData;
|
||||||
// private ActorAI ai;
|
// private ActorAI ai;
|
||||||
@@ -18,6 +20,8 @@ public class TestNPC extends ActorWithBody implements AIControlled, Pocketed, Ca
|
|||||||
|
|
||||||
private HashSet<Faction> factionSet = new HashSet<>();
|
private HashSet<Faction> factionSet = new HashSet<>();
|
||||||
|
|
||||||
|
private ArrayList<Integer> houseTiles = new ArrayList<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attachAI() {
|
public void attachAI() {
|
||||||
|
|
||||||
@@ -88,6 +92,31 @@ public class TestNPC extends ActorWithBody implements AIControlled, Pocketed, Ca
|
|||||||
return super.getMass();
|
return super.getMass();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ArrayList<Integer> getHouseDesignation() {
|
||||||
|
return houseTiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setHouseDesignation(ArrayList<Integer> list) {
|
||||||
|
houseTiles = list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addHouseTile(int x, int y) {
|
||||||
|
houseTiles.add(Terrarum.game.map.width * y + x);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeHouseTile(int x, int y) {
|
||||||
|
houseTiles.remove(new Integer(Terrarum.game.map.width * y + x));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clearHouseDesignation() {
|
||||||
|
houseTiles.clear();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stopUpdateAndDraw() {
|
public void stopUpdateAndDraw() {
|
||||||
super.setUpdate(false);
|
super.setUpdate(false);
|
||||||
@@ -55,7 +55,7 @@ public class Player extends ActorWithBody implements Controllable, Pocketed, Fac
|
|||||||
|
|
||||||
private final int TSIZE = MapDrawer.TILE_SIZE;
|
private final int TSIZE = MapDrawer.TILE_SIZE;
|
||||||
|
|
||||||
private int LUMINANCE_RGB = 0xFFFFFF;
|
private char LUMINANCE_RGB = 63999;
|
||||||
|
|
||||||
private HashSet<Faction> factionSet = new HashSet<>();
|
private HashSet<Faction> factionSet = new HashSet<>();
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@ public class Player extends ActorWithBody implements Controllable, Pocketed, Fac
|
|||||||
* |
|
* |
|
||||||
* 0+------············ t
|
* 0+------············ t
|
||||||
*
|
*
|
||||||
* which is unrealistic, so this method tries to introduce some realism by:
|
* which is unrealistic, so this method tries to introduce some realism by doing:
|
||||||
*
|
*
|
||||||
* a
|
* a
|
||||||
* | ------------
|
* | ------------
|
||||||
@@ -547,12 +547,12 @@ public class Player extends ActorWithBody implements Controllable, Pocketed, Fac
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setLuminance(int RGB) {
|
public void setLuminance(char RGB) {
|
||||||
LUMINANCE_RGB = RGB;
|
LUMINANCE_RGB = RGB;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getLuminance() {
|
public char getLuminance() {
|
||||||
return LUMINANCE_RGB;
|
return LUMINANCE_RGB;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,38 +3,40 @@ package com.Torvald.Terrarum.ConsoleCommand;
|
|||||||
import com.Torvald.Terrarum.Terrarum;
|
import com.Torvald.Terrarum.Terrarum;
|
||||||
import com.Torvald.Terrarum.UserInterface.ConsoleWindow;
|
import com.Torvald.Terrarum.UserInterface.ConsoleWindow;
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
import org.newdawn.slick.SlickException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by minjaesong on 16-02-19.
|
* Created by minjaesong on 16-02-19.
|
||||||
*/
|
*/
|
||||||
public class Authenticator implements ConsoleCommand {
|
public class Authenticator implements ConsoleCommand {
|
||||||
|
|
||||||
private static final String A = "0d34076fc15db1b7c7a0943045699eba6f186ec1"; // alpine
|
private static boolean a = false;
|
||||||
// or 'srisrimahasri'
|
|
||||||
|
|
||||||
private static boolean B = false;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(String[] args) {
|
public void execute(String[] args) {
|
||||||
if (args.length == 2) {
|
if (args.length == 2) {
|
||||||
String pwd = args[1];
|
String pwd = args[1];
|
||||||
|
|
||||||
String hashedPwd = DigestUtils.sha1Hex(pwd);
|
String hashedPwd = DigestUtils.sha256Hex(pwd);
|
||||||
|
|
||||||
if (A.equalsIgnoreCase(hashedPwd)) {
|
if ("54c5b3dd459d5ef778bb2fa1e23a5fb0e1b62ae66970bcb436e8f81a1a1a8e41".equalsIgnoreCase(hashedPwd)) {
|
||||||
new Echo().execute(((B) ? "Dis" : "") + "authenticated.");
|
// alpine
|
||||||
B = !B;
|
String msg = (a) ? "Locked" : "Authenticated";
|
||||||
|
new Echo().execute(msg);
|
||||||
|
System.out.println("[Authenticator] " + msg);
|
||||||
|
a = !a;
|
||||||
((ConsoleWindow) (Terrarum.game.consoleHandler.getUI())).reset();
|
((ConsoleWindow) (Terrarum.game.consoleHandler.getUI())).reset();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
printUsage(); // thou shalt not pass!
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
printUsage();
|
printUsage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean C() {
|
public boolean b() {
|
||||||
return B;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class CommandInterpreter {
|
|||||||
new Zoom().execute(single_command.toStringArray());
|
new Zoom().execute(single_command.toStringArray());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (Terrarum.game.auth.C()) {
|
if (Terrarum.game.auth.b()) {
|
||||||
ConsoleCommand commandObj = CommandDict.getCommand(
|
ConsoleCommand commandObj = CommandDict.getCommand(
|
||||||
single_command.getName().toLowerCase());
|
single_command.getName().toLowerCase());
|
||||||
commandObj.execute(single_command.toStringArray());
|
commandObj.execute(single_command.toStringArray());
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.Torvald.Terrarum.ConsoleCommand;
|
package com.Torvald.Terrarum.ConsoleCommand;
|
||||||
|
|
||||||
|
import com.Torvald.Terrarum.MapDrawer.LightmapRenderer;
|
||||||
import com.Torvald.Terrarum.Terrarum;
|
import com.Torvald.Terrarum.Terrarum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,13 +14,32 @@ public class SetGlobalLightLevel implements ConsoleCommand {
|
|||||||
int r = new Integer(args[1]);
|
int r = new Integer(args[1]);
|
||||||
int g = new Integer(args[2]);
|
int g = new Integer(args[2]);
|
||||||
int b = new Integer(args[3]);
|
int b = new Integer(args[3]);
|
||||||
int GL = (r << 16) | (g << 8) | b;
|
char GL = LightmapRenderer.constructRGBFromInt(r, g, b);
|
||||||
|
|
||||||
Terrarum.game.map.setGlobalLight(GL);
|
Terrarum.game.map.setGlobalLight(GL);
|
||||||
}
|
}
|
||||||
catch (NumberFormatException e) {
|
catch (NumberFormatException e) {
|
||||||
new Echo().execute("Wrong number input.");
|
new Echo().execute("Wrong number input.");
|
||||||
}
|
}
|
||||||
|
catch (IllegalArgumentException e1) {
|
||||||
|
new Echo().execute("Range: 0-" + LightmapRenderer.CHANNEL_MAX + " per channel");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (args.length == 2) {
|
||||||
|
try {
|
||||||
|
char GL = (char) (new Integer(args[1]).intValue());
|
||||||
|
|
||||||
|
if (GL < 0 || GL >= LightmapRenderer.COLOUR_DOMAIN_SIZE) {
|
||||||
|
new Echo().execute("Range: 0-" + (LightmapRenderer.COLOUR_DOMAIN_SIZE - 1));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Terrarum.game.map.setGlobalLight(GL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (NumberFormatException e) {
|
||||||
|
new Echo().execute("Wrong number input.");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
printUsage();
|
printUsage();
|
||||||
@@ -28,6 +48,6 @@ public class SetGlobalLightLevel implements ConsoleCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void printUsage() {
|
public void printUsage() {
|
||||||
new Echo().execute("Usage: setgl r g b");
|
new Echo().execute("Usage: setgl [raw_value|r g b]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.Torvald.Terrarum.ConsoleCommand;
|
package com.Torvald.Terrarum.ConsoleCommand;
|
||||||
|
|
||||||
|
import com.Torvald.ImageFont.GameFontBase;
|
||||||
import com.Torvald.Terrarum.LangPack.Lang;
|
import com.Torvald.Terrarum.LangPack.Lang;
|
||||||
import com.Torvald.Terrarum.Terrarum;
|
import com.Torvald.Terrarum.Terrarum;
|
||||||
|
import org.newdawn.slick.SlickException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@@ -17,6 +19,12 @@ public class SetLocale implements ConsoleCommand {
|
|||||||
try {
|
try {
|
||||||
new Lang();
|
new Lang();
|
||||||
new Echo().execute("Set locale to '" + Terrarum.gameLocale + "'.");
|
new Echo().execute("Set locale to '" + Terrarum.gameLocale + "'.");
|
||||||
|
|
||||||
|
if ((!prevLocale.contains("cn") && Terrarum.gameLocale.contains("cn"))
|
||||||
|
|| (prevLocale.contains("cn") && !Terrarum.gameLocale.contains("cn"))) {
|
||||||
|
try { ((GameFontBase) Terrarum.gameFontWhite).reloadUnihan(); }
|
||||||
|
catch (SlickException e) { e.printStackTrace(); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (IOException e) {
|
catch (IOException e) {
|
||||||
new Echo().execute("Locale '"
|
new Echo().execute("Locale '"
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package com.Torvald.Terrarum.GameControl;
|
|||||||
|
|
||||||
import com.Torvald.Terrarum.Actors.Controllable;
|
import com.Torvald.Terrarum.Actors.Controllable;
|
||||||
import com.Torvald.Terrarum.Actors.Player;
|
import com.Torvald.Terrarum.Actors.Player;
|
||||||
|
import com.Torvald.Terrarum.MapDrawer.MapCamera;
|
||||||
|
import com.Torvald.Terrarum.MapDrawer.MapDrawer;
|
||||||
import com.Torvald.Terrarum.Terrarum;
|
import com.Torvald.Terrarum.Terrarum;
|
||||||
import com.Torvald.Terrarum.UserInterface.UIHandler;
|
import com.Torvald.Terrarum.UserInterface.UIHandler;
|
||||||
import org.newdawn.slick.Input;
|
import org.newdawn.slick.Input;
|
||||||
@@ -75,7 +77,16 @@ public class GameController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void mousePressed(int button, int x, int y) {
|
public static void mousePressed(int button, int x, int y) {
|
||||||
|
int mouseTileX = (int) ((MapCamera.getCameraX() + x / Terrarum.game.screenZoom)
|
||||||
|
/ MapDrawer.TILE_SIZE);
|
||||||
|
int mouseTileY = (int) ((MapCamera.getCameraY() + y / Terrarum.game.screenZoom)
|
||||||
|
/ MapDrawer.TILE_SIZE);
|
||||||
|
|
||||||
|
try {
|
||||||
|
Terrarum.game.map.setTileTerrain(mouseTileX, mouseTileY, (byte) 0);
|
||||||
|
Terrarum.game.map.setTileWall(mouseTileX, mouseTileY, (byte) 0);
|
||||||
|
}
|
||||||
|
catch (ArrayIndexOutOfBoundsException e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void mouseReleased(int button, int x, int y) {
|
public static void mouseReleased(int button, int x, int y) {
|
||||||
|
|||||||
@@ -31,8 +31,6 @@ public class GameMap {
|
|||||||
public int spawnX;
|
public int spawnX;
|
||||||
public int spawnY;
|
public int spawnY;
|
||||||
|
|
||||||
private LinkedList<MapPoint> houseDesignation;
|
|
||||||
|
|
||||||
public static final int WALL = 0;
|
public static final int WALL = 0;
|
||||||
public static final int TERRAIN = 1;
|
public static final int TERRAIN = 1;
|
||||||
public static final int WIRE = 2;
|
public static final int WIRE = 2;
|
||||||
@@ -40,7 +38,7 @@ public class GameMap {
|
|||||||
//public World physWorld = new World( new Vec2(0, -TerrarumMain.game.gravitationalAccel) );
|
//public World physWorld = new World( new Vec2(0, -TerrarumMain.game.gravitationalAccel) );
|
||||||
//physics
|
//physics
|
||||||
private float gravitation;
|
private float gravitation;
|
||||||
private int globalLight;
|
private char globalLight;
|
||||||
private WorldTime worldTime;
|
private WorldTime worldTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -59,7 +57,7 @@ public class GameMap {
|
|||||||
layerWire = new MapLayer(width, height);
|
layerWire = new MapLayer(width, height);
|
||||||
terrainDamageCode = new PairedMapLayer(width, height);
|
terrainDamageCode = new PairedMapLayer(width, height);
|
||||||
|
|
||||||
globalLight = 0xFFFFFF;
|
globalLight = (char) 63999;
|
||||||
worldTime = new WorldTime();
|
worldTime = new WorldTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,6 +138,18 @@ public class GameMap {
|
|||||||
return terrainDamageCode.getData(x, y);
|
return terrainDamageCode.getData(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setTileWall(int x, int y, byte tile) {
|
||||||
|
layerWall.data[y][x] = tile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTileTerrain(int x, int y, byte tile) {
|
||||||
|
layerTerrain.data[y][x] = tile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTileWire(int x, int y, byte tile) {
|
||||||
|
layerWire.data[y][x] = tile;
|
||||||
|
}
|
||||||
|
|
||||||
public int getTileFrom(int mode, int x, int y) {
|
public int getTileFrom(int mode, int x, int y) {
|
||||||
if (mode == TERRAIN) { return getTileFromTerrain(x, y); }
|
if (mode == TERRAIN) { return getTileFromTerrain(x, y); }
|
||||||
else if (mode == WALL) { return getTileFromWall(x, y); }
|
else if (mode == WALL) { return getTileFromWall(x, y); }
|
||||||
@@ -161,11 +171,11 @@ public class GameMap {
|
|||||||
return gravitation;
|
return gravitation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getGlobalLight() {
|
public char getGlobalLight() {
|
||||||
return globalLight;
|
return globalLight;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGlobalLight(int globalLight) {
|
public void setGlobalLight(char globalLight) {
|
||||||
this.globalLight = globalLight;
|
this.globalLight = globalLight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
* Drawing
|
* Drawing
|
||||||
|
|
||||||
- Players can create their own décors (hang on wall), dresses.
|
- Players can create their own décors (hang on wall), dresses.
|
||||||
- Two looms (3-3-2 colour mode, 4096 colour mode)
|
- Two looms (216 colour mode, 4096 colour mode)
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.Torvald.Terrarum.MapDrawer;
|
package com.Torvald.Terrarum.MapDrawer;
|
||||||
|
|
||||||
|
import com.Torvald.ColourUtil.Col40;
|
||||||
import com.Torvald.Terrarum.Terrarum;
|
import com.Torvald.Terrarum.Terrarum;
|
||||||
import com.Torvald.Terrarum.TileProperties.TilePropCodex;
|
import com.Torvald.Terrarum.TileProperties.TilePropCodex;
|
||||||
import com.jme3.math.FastMath;
|
import com.jme3.math.FastMath;
|
||||||
@@ -17,7 +18,7 @@ public class LightmapRenderer {
|
|||||||
/**
|
/**
|
||||||
* 8-Bit RGB values
|
* 8-Bit RGB values
|
||||||
*/
|
*/
|
||||||
private static volatile int[][] staticLightMap;
|
private static volatile char[][] staticLightMap;
|
||||||
private static boolean lightMapInitialised = false;
|
private static boolean lightMapInitialised = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,6 +27,7 @@ public class LightmapRenderer {
|
|||||||
private static ArrayList<LightmapLantern> lanterns = new ArrayList<>();
|
private static ArrayList<LightmapLantern> lanterns = new ArrayList<>();
|
||||||
|
|
||||||
private static final int AIR = 0;
|
private static final int AIR = 0;
|
||||||
|
private static final int SUNSTONE = 41; // TODO add sunstone: emits same light as Map.GL. Goes dark at night
|
||||||
|
|
||||||
|
|
||||||
private static final int OFFSET_R = 2;
|
private static final int OFFSET_R = 2;
|
||||||
@@ -34,18 +36,18 @@ public class LightmapRenderer {
|
|||||||
|
|
||||||
private static final int TSIZE = MapDrawer.TILE_SIZE;
|
private static final int TSIZE = MapDrawer.TILE_SIZE;
|
||||||
|
|
||||||
/**
|
// color model related vars
|
||||||
* Stores current light map as image.
|
public static final int MUL = Col40.MUL;
|
||||||
* WILL BE PURGED in every single round of light calculation.
|
public static final int MUL_2 = Col40.MUL_2;
|
||||||
*/
|
public static final int CHANNEL_MAX = Col40.MAX_STEP;
|
||||||
//private static Graphics lightMapGraphicsInstance;
|
public static final float CHANNEL_MAX_FLOAT = (float) CHANNEL_MAX;
|
||||||
|
public static final int COLOUR_DOMAIN_SIZE = Col40.COLOUR_DOMAIN_SIZE;
|
||||||
|
|
||||||
public LightmapRenderer() {
|
public LightmapRenderer() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addLantern(int x, int y, int intensity) {
|
public static void addLantern(int x, int y, char intensity) {
|
||||||
LightmapLantern thisLantern = new LightmapLantern(x, y, intensity);
|
LightmapLantern thisLantern = new LightmapLantern(x, y, intensity);
|
||||||
|
|
||||||
for (int i = lanterns.size() - 1; i >= 0; i--) {
|
for (int i = lanterns.size() - 1; i >= 0; i--) {
|
||||||
@@ -53,7 +55,7 @@ public class LightmapRenderer {
|
|||||||
// found duplicates
|
// found duplicates
|
||||||
if (lanternInList.getX() == x && lanternInList.getY() == y) {
|
if (lanternInList.getX() == x && lanternInList.getY() == y) {
|
||||||
// add colour
|
// add colour
|
||||||
int addedL = addRaw(intensity, lanternInList.getIntensity());
|
char addedL = addRaw(intensity, lanternInList.getIntensity());
|
||||||
lanternInList.intensity = addedL;
|
lanternInList.intensity = addedL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -73,7 +75,7 @@ public class LightmapRenderer {
|
|||||||
|
|
||||||
public static void renderLightMap() {
|
public static void renderLightMap() {
|
||||||
if (staticLightMap == null) {
|
if (staticLightMap == null) {
|
||||||
staticLightMap = new int[Terrarum.game.map.height][Terrarum.game.map.width];
|
staticLightMap = new char[Terrarum.game.map.height][Terrarum.game.map.width];
|
||||||
|
|
||||||
if (lightMapInitialised) {
|
if (lightMapInitialised) {
|
||||||
throw new RuntimeException("Attempting to re-initialise 'staticLightMap'");
|
throw new RuntimeException("Attempting to re-initialise 'staticLightMap'");
|
||||||
@@ -145,7 +147,7 @@ public class LightmapRenderer {
|
|||||||
for (int x = for_x_start; x < for_x_end; x++) {
|
for (int x = for_x_start; x < for_x_end; x++) {
|
||||||
// smooth
|
// smooth
|
||||||
if (Terrarum.game.screenZoom >= 1 && ((boolean) Terrarum.game.gameConfig.get("smoothlighting"))) {
|
if (Terrarum.game.screenZoom >= 1 && ((boolean) Terrarum.game.gameConfig.get("smoothlighting"))) {
|
||||||
int thisLightLevel = staticLightMap[y][x];
|
char thisLightLevel = staticLightMap[y][x];
|
||||||
if (y > 0 && x < for_x_end && thisLightLevel == 0 && staticLightMap[y - 1][x] == 0) {
|
if (y > 0 && x < for_x_end && thisLightLevel == 0 && staticLightMap[y - 1][x] == 0) {
|
||||||
// coalesce zero intensity blocks to one
|
// coalesce zero intensity blocks to one
|
||||||
int zeroLevelCounter = 1;
|
int zeroLevelCounter = 1;
|
||||||
@@ -175,23 +177,25 @@ public class LightmapRenderer {
|
|||||||
* +-+-+
|
* +-+-+
|
||||||
* d
|
* d
|
||||||
*/
|
*/
|
||||||
int a = (y == 0) ? thisLightLevel
|
char a = (y == 0) ? thisLightLevel
|
||||||
: (y == Terrarum.game.map.height - 1) ? thisLightLevel
|
: (y == Terrarum.game.map.height - 1) ? thisLightLevel
|
||||||
: Math.max(staticLightMap[y][x]
|
: max(staticLightMap[y][x]
|
||||||
, staticLightMap[y - 1][x]);
|
, staticLightMap[y - 1][x]);
|
||||||
int d = (y == 0) ? thisLightLevel
|
char d = (y == 0) ? thisLightLevel
|
||||||
: (y == Terrarum.game.map.height - 1) ? thisLightLevel
|
: (y == Terrarum.game.map.height - 1) ? thisLightLevel
|
||||||
: Math.max(staticLightMap[y][x]
|
: max(staticLightMap[y][x]
|
||||||
, staticLightMap[y + 1][x]);
|
, staticLightMap[y + 1][x]);
|
||||||
int b = (x == 0) ? thisLightLevel
|
char b = (x == 0) ? thisLightLevel
|
||||||
: (x == Terrarum.game.map.width - 1) ? thisLightLevel
|
: (x == Terrarum.game.map.width - 1) ? thisLightLevel
|
||||||
: Math.max(staticLightMap[y][x]
|
: max(staticLightMap[y][x]
|
||||||
, staticLightMap[y][x - 1]);
|
, staticLightMap[y][x - 1]);
|
||||||
int c = (x == 0) ? thisLightLevel
|
char c = (x == 0) ? thisLightLevel
|
||||||
: (x == Terrarum.game.map.width - 1) ? thisLightLevel
|
: (x == Terrarum.game.map.width - 1) ? thisLightLevel
|
||||||
: Math.max(staticLightMap[y][x]
|
: max(staticLightMap[y][x]
|
||||||
, staticLightMap[y][x + 1]);
|
, staticLightMap[y][x + 1]);
|
||||||
int[] colourMapItoL = new int[4];
|
char t = staticLightMap[y][x];
|
||||||
|
|
||||||
|
char[] colourMapItoL = new char[4];
|
||||||
colourMapItoL[0] = colourLinearMix(a, b);
|
colourMapItoL[0] = colourLinearMix(a, b);
|
||||||
colourMapItoL[1] = colourLinearMix(a, c);
|
colourMapItoL[1] = colourLinearMix(a, c);
|
||||||
colourMapItoL[2] = colourLinearMix(b, d);
|
colourMapItoL[2] = colourLinearMix(b, d);
|
||||||
@@ -199,7 +203,7 @@ public class LightmapRenderer {
|
|||||||
|
|
||||||
for (int iy = 0; iy < 2; iy++) {
|
for (int iy = 0; iy < 2; iy++) {
|
||||||
for (int ix = 0; ix < 2; ix++) {
|
for (int ix = 0; ix < 2; ix++) {
|
||||||
g.setColor(new Color(colourMapItoL[iy * 2 + ix]));
|
g.setColor(toTargetColour(colourMapItoL[iy * 2 + ix]));
|
||||||
|
|
||||||
g.fillRect(
|
g.fillRect(
|
||||||
Math.round(x * TSIZE * Terrarum.game.screenZoom) + (ix * TSIZE / 2 * Terrarum.game.screenZoom)
|
Math.round(x * TSIZE * Terrarum.game.screenZoom) + (ix * TSIZE / 2 * Terrarum.game.screenZoom)
|
||||||
@@ -223,7 +227,7 @@ public class LightmapRenderer {
|
|||||||
if (x + sameLevelCounter >= for_x_end) break;
|
if (x + sameLevelCounter >= for_x_end) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
g.setColor(new Color(staticLightMap[y][x]));
|
g.setColor(toTargetColour(staticLightMap[y][x]));
|
||||||
g.fillRect(
|
g.fillRect(
|
||||||
Math.round(x * TSIZE * Terrarum.game.screenZoom)
|
Math.round(x * TSIZE * Terrarum.game.screenZoom)
|
||||||
, Math.round(y * TSIZE * Terrarum.game.screenZoom)
|
, Math.round(y * TSIZE * Terrarum.game.screenZoom)
|
||||||
@@ -237,13 +241,17 @@ public class LightmapRenderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int calculate(int x, int y){
|
private static Color toTargetColour(char raw) {
|
||||||
|
return new Col40().createSlickColor(raw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static char calculate(int x, int y){
|
||||||
if (!outOfBounds(x, y)){
|
if (!outOfBounds(x, y)){
|
||||||
|
|
||||||
float lightColorR = 1f;
|
float lightColorR = 1f;
|
||||||
float lightColorG = 1f;
|
float lightColorG = 1f;
|
||||||
float lightColorB = 1f;
|
float lightColorB = 1f;
|
||||||
int lightColorInt;
|
char lightColorInt;
|
||||||
|
|
||||||
int thisTerrain = Terrarum.game.map.getTileFromTerrain(x, y);
|
int thisTerrain = Terrarum.game.map.getTileFromTerrain(x, y);
|
||||||
int thisWall = Terrarum.game.map.getTileFromWall(x, y);
|
int thisWall = Terrarum.game.map.getTileFromWall(x, y);
|
||||||
@@ -255,7 +263,7 @@ public class LightmapRenderer {
|
|||||||
else {
|
else {
|
||||||
// mix light emitter
|
// mix light emitter
|
||||||
if (TilePropCodex.getProp(thisTerrain).getLuminosity() != 0) {
|
if (TilePropCodex.getProp(thisTerrain).getLuminosity() != 0) {
|
||||||
int lum = TilePropCodex.getProp(thisTerrain).getLuminosity();
|
char lum = TilePropCodex.getProp(thisTerrain).getLuminosity();
|
||||||
lightColorR = getR(lum);
|
lightColorR = getR(lum);
|
||||||
lightColorG = getG(lum);
|
lightColorG = getG(lum);
|
||||||
lightColorB = getB(lum);
|
lightColorB = getB(lum);
|
||||||
@@ -264,7 +272,7 @@ public class LightmapRenderer {
|
|||||||
// mix lantern
|
// mix lantern
|
||||||
for (LightmapLantern lantern : lanterns) {
|
for (LightmapLantern lantern : lanterns) {
|
||||||
if (lantern.getX() == x && lantern.getY() == y) {
|
if (lantern.getX() == x && lantern.getY() == y) {
|
||||||
int lum = lantern.getIntensity();
|
char lum = lantern.getIntensity();
|
||||||
lightColorR = getR(lum);
|
lightColorR = getR(lum);
|
||||||
lightColorG = getG(lum);
|
lightColorG = getG(lum);
|
||||||
lightColorB = getB(lum);
|
lightColorB = getB(lum);
|
||||||
@@ -277,7 +285,7 @@ public class LightmapRenderer {
|
|||||||
int tileX = Math.round(Terrarum.game.getPlayer().getHitbox().getPointedX() / TSIZE);
|
int tileX = Math.round(Terrarum.game.getPlayer().getHitbox().getPointedX() / TSIZE);
|
||||||
int tileY = Math.round(Terrarum.game.getPlayer().getHitbox().getPointedY() / TSIZE)
|
int tileY = Math.round(Terrarum.game.getPlayer().getHitbox().getPointedY() / TSIZE)
|
||||||
- 1;
|
- 1;
|
||||||
int lum = Terrarum.game.getPlayer().getLuminance();
|
char lum = Terrarum.game.getPlayer().getLuminance();
|
||||||
if (x == tileX && y == tileY) {
|
if (x == tileX && y == tileY) {
|
||||||
lightColorR = getR(lum);
|
lightColorR = getR(lum);
|
||||||
lightColorG = getG(lum);
|
lightColorG = getG(lum);
|
||||||
@@ -286,49 +294,56 @@ public class LightmapRenderer {
|
|||||||
|
|
||||||
float[] bgrVal = new float[3]; // {B, G, R}
|
float[] bgrVal = new float[3]; // {B, G, R}
|
||||||
|
|
||||||
// test for each R, G, B channel
|
// test for each B, G, R channel
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
int brightest = 0;
|
int brightest = 0;
|
||||||
|
|
||||||
//get brightest of nearby 4 tiles
|
//get brightest of nearby 4 tiles
|
||||||
int nearby = 0;
|
int nearby = 0b0;
|
||||||
findNearbyBrightest:
|
findNearbyBrightest:
|
||||||
for (int yoff = -1; yoff <= 1; yoff++) {
|
for (int yoff = -1; yoff <= 1; yoff++) {
|
||||||
for (int xoff = -1; xoff <= 1; xoff++) {
|
for (int xoff = -1; xoff <= 1; xoff++) {
|
||||||
/**
|
/**
|
||||||
* filter for 'v's as:
|
* filter for 'v's as:
|
||||||
* +-+-+-+
|
* +-+-+-+
|
||||||
* | |v| |
|
* |a|v|a|
|
||||||
* +-+-+-+
|
* +-+-+-+
|
||||||
* |v| |v|
|
* |v| |v|
|
||||||
* +-+-+-+
|
* +-+-+-+
|
||||||
* | |v| |
|
* |a|v|a|
|
||||||
* +-+-+-+
|
* +-+-+-+
|
||||||
*/
|
*/
|
||||||
if (xoff != yoff && -xoff != yoff) {
|
if (xoff != yoff && -xoff != yoff) { // 'v' tiles
|
||||||
if (!outOfMapBounds(x + xoff, y + yoff)) {
|
if (!outOfMapBounds(x + xoff, y + yoff)) {
|
||||||
nearby = getRaw(staticLightMap[y + yoff][x + xoff], i);
|
nearby = getRaw(staticLightMap[y + yoff][x + xoff], i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nearby > brightest) {
|
|
||||||
brightest = nearby;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (brightest == 0xFF) break findNearbyBrightest;
|
|
||||||
}
|
}
|
||||||
|
else if (xoff != 0 && yoff != 0) { // 'a' tiles
|
||||||
|
if (!outOfMapBounds(x + xoff, y + yoff)) {
|
||||||
|
nearby = darken((char) getRaw(staticLightMap[y + yoff][x + xoff], i)
|
||||||
|
, 0x3); //mix some to have more 'spreading'
|
||||||
|
// so that light spreads in a shape of an octagon instead of a diamond
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nearby > brightest) {
|
||||||
|
brightest = nearby;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (brightest == CHANNEL_MAX) break findNearbyBrightest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//return: brightest - opacity
|
//return: brightest - opacity
|
||||||
bgrVal[i] = darkenFloat(
|
bgrVal[i] = darkenFloat(
|
||||||
brightest
|
(char) (brightest)
|
||||||
, TilePropCodex.getProp(thisTerrain).getOpacity()
|
, TilePropCodex.getProp(thisTerrain).getOpacity()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// construct lightColor from bgrVal
|
// construct lightColor from bgrVal
|
||||||
lightColorInt = constructRGBFromFloat(
|
lightColorInt = constructRGBFromFloat(
|
||||||
bgrVal[OFFSET_R] * lightColorR
|
bgrVal[OFFSET_R] * lightColorR
|
||||||
, bgrVal[OFFSET_G] * lightColorG
|
, bgrVal[OFFSET_G] * lightColorG
|
||||||
, bgrVal[OFFSET_B] * lightColorB
|
, bgrVal[OFFSET_B] * lightColorB
|
||||||
);
|
);
|
||||||
@@ -344,36 +359,41 @@ public class LightmapRenderer {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param data Raw channel value [0-255]
|
* @param data Raw channel value [0-39] per channel
|
||||||
* @param darken [0-255]
|
* @param darken [0-39] per channel
|
||||||
* @return darkened data [0-1]
|
* @return darkened data [0-9] per channel (darken-int divided by 39)
|
||||||
*/
|
*/
|
||||||
private static float darkenFloat(int data, int darken) {
|
private static float darkenFloat(char data, int darken) {
|
||||||
return (darken(data, darken) / 255f);
|
return (darken(data, darken) / CHANNEL_MAX_FLOAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param data Raw channel value [0-255]
|
* @param data Raw channel value [0-39] per channel
|
||||||
* @param darken [0-255]
|
* @param darken [0-39] per channel
|
||||||
* @return darkened data [0-255]
|
* @return darkened data [0-39] per channel
|
||||||
*/
|
*/
|
||||||
private static int darken(int data, int darken) {
|
private static char darken(char data, int darken) {
|
||||||
if (darken < 0 || darken > 0xFF) { throw new IllegalArgumentException("darken: out of range"); }
|
if (darken < 0 || darken > CHANNEL_MAX) { throw new IllegalArgumentException("darken: out of " +
|
||||||
|
"range"); }
|
||||||
|
|
||||||
return clampZero(data - darken);
|
int r = clampZero(getRawR(data) - darken);
|
||||||
|
int g = clampZero(getRawG(data) - darken);
|
||||||
|
int b = clampZero(getRawB(data) - darken);
|
||||||
|
|
||||||
|
return constructRGBFromInt(r, g, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getRawR(int RGB) {
|
public static int getRawR(char RGB) {
|
||||||
return (RGB >> 16) & 0xFF;
|
return RGB / MUL_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getRawG(int RGB) {
|
public static int getRawG(char RGB) {
|
||||||
return (RGB >> 8) & 0xFF;
|
return (RGB % MUL_2) / MUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getRawB(int RGB) {
|
public static int getRawB(char RGB) {
|
||||||
return RGB & 0xFF;
|
return RGB % MUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -382,24 +402,26 @@ public class LightmapRenderer {
|
|||||||
* @param offset 2 = R, 1 = G, 0 = B
|
* @param offset 2 = R, 1 = G, 0 = B
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private static int getRaw(int RGB, int offset) {
|
public static int getRaw(char RGB, int offset) {
|
||||||
if (offset < 0 || offset > 2) throw new IllegalArgumentException("Offset out of range");
|
if (offset == OFFSET_R) return getRawR(RGB);
|
||||||
return (RGB >> (8 * offset)) & 0xFF;
|
if (offset == OFFSET_G) return getRawG(RGB);
|
||||||
|
if (offset == OFFSET_B) return getRawB(RGB);
|
||||||
|
else throw new IllegalArgumentException("Channel offset out of range");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static float getR(int rgb) {
|
private static float getR(char rgb) {
|
||||||
return getRawR(rgb) / 255f;
|
return getRawR(rgb) / CHANNEL_MAX_FLOAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static float getG(int rgb) {
|
private static float getG(char rgb) {
|
||||||
return getRawG(rgb) / 255f;
|
return getRawG(rgb) / CHANNEL_MAX_FLOAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static float getB(int rgb) {
|
private static float getB(char rgb) {
|
||||||
return getRawB(rgb) / 255f;
|
return getRawB(rgb) / CHANNEL_MAX_FLOAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int addRaw(int rgb1, int rgb2) {
|
private static char addRaw(char rgb1, char rgb2) {
|
||||||
int newR = clampByte(getRawR(rgb1) + getRawB(rgb2));
|
int newR = clampByte(getRawR(rgb1) + getRawB(rgb2));
|
||||||
int newG = clampByte(getRawG(rgb1) + getRawG(rgb2));
|
int newG = clampByte(getRawG(rgb1) + getRawG(rgb2));
|
||||||
int newB = clampByte(getRawB(rgb1) + getRawB(rgb2));
|
int newB = clampByte(getRawB(rgb1) + getRawB(rgb2));
|
||||||
@@ -407,51 +429,32 @@ public class LightmapRenderer {
|
|||||||
return constructRGBFromInt(newR, newG, newB);
|
return constructRGBFromInt(newR, newG, newB);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int constructRGBFromInt(int r, int g, int b) {
|
public static char constructRGBFromInt(int r, int g, int b) {
|
||||||
if (r < 0 || r > 0xFF) { throw new IllegalArgumentException("Red: out of range"); }
|
if (r < 0 || r > CHANNEL_MAX) { throw new IllegalArgumentException("Red: out of range"); }
|
||||||
if (g < 0 || g > 0xFF) { throw new IllegalArgumentException("Green: out of range"); }
|
if (g < 0 || g > CHANNEL_MAX) { throw new IllegalArgumentException("Green: out of range"); }
|
||||||
if (b < 0 || b > 0xFF) { throw new IllegalArgumentException("Blue: out of range"); }
|
if (b < 0 || b > CHANNEL_MAX) { throw new IllegalArgumentException("Blue: out of range"); }
|
||||||
return (r << 16) | (g << 8) | b;
|
return (char) (r * MUL_2 + g * MUL + b);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int constructRGBFromFloat(float r, float g, float b) {
|
private static char constructRGBFromFloat(float r, float g, float b) {
|
||||||
if (r < 0 || r > 1.0f) { throw new IllegalArgumentException("Red: out of range"); }
|
if (r < 0 || r > 1.0f) { throw new IllegalArgumentException("Red: out of range"); }
|
||||||
if (g < 0 || g > 1.0f) { throw new IllegalArgumentException("Green: out of range"); }
|
if (g < 0 || g > 1.0f) { throw new IllegalArgumentException("Green: out of range"); }
|
||||||
if (b < 0 || b > 1.0f) { throw new IllegalArgumentException("Blue: out of range"); }
|
if (b < 0 || b > 1.0f) { throw new IllegalArgumentException("Blue: out of range"); }
|
||||||
|
|
||||||
int intR = Math.round(r * 0xFF);
|
int intR = Math.round(r * CHANNEL_MAX);
|
||||||
int intG = Math.round(g * 0xFF);
|
int intG = Math.round(g * CHANNEL_MAX);
|
||||||
int intB = Math.round(b * 0xFF);
|
int intB = Math.round(b * CHANNEL_MAX);
|
||||||
|
|
||||||
return constructRGBFromInt(intR, intG, intB);
|
return constructRGBFromInt(intR, intG, intB);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int colourLinearMix(int colA, int colB) {
|
private static char colourLinearMix(char colA, char colB) {
|
||||||
int r = (getRawR(colA) + getRawR(colB)) >> 1;
|
int r = (getRawR(colA) + getRawR(colB)) >> 1;
|
||||||
int g = (getRawG(colA) + getRawG(colB)) >> 1;
|
int g = (getRawG(colA) + getRawG(colB)) >> 1;
|
||||||
int b = (getRawB(colA) + getRawB(colB)) >> 1;
|
int b = (getRawB(colA) + getRawB(colB)) >> 1;
|
||||||
return constructRGBFromInt(r, g, b);
|
return constructRGBFromInt(r, g, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param thisTile
|
|
||||||
* @param side1
|
|
||||||
* @param side2
|
|
||||||
* @param corner
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private static int colourQuadraticMix(int thisTile, int side1, int side2, int corner) {
|
|
||||||
int rSide = max(getRawR(side1), getRawR(side2), getRawR(corner) / 2);
|
|
||||||
int r = arithmeticAverage(rSide, getRawR(thisTile));
|
|
||||||
int gSide = max(getRawG(side1), getRawG(side2), getRawG(corner) / 2);
|
|
||||||
int g = arithmeticAverage(gSide, getRawG(thisTile));
|
|
||||||
int bSide = max(getRawG(side1), getRawG(side2), getRawG(corner) / 2);
|
|
||||||
int b = arithmeticAverage(bSide, getRawG(thisTile));
|
|
||||||
|
|
||||||
return constructRGBFromInt(r, g, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int quantise16(int x) {
|
private static int quantise16(int x) {
|
||||||
if (x < 0) throw new IllegalArgumentException("positive integer only.");
|
if (x < 0) throw new IllegalArgumentException("positive integer only.");
|
||||||
return (x & 0xFFFF_FFF0);
|
return (x & 0xFFFF_FFF0);
|
||||||
@@ -467,12 +470,12 @@ public class LightmapRenderer {
|
|||||||
return (x << 4);
|
return (x << 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int max(int... i) {
|
private static char max(char... i) {
|
||||||
Arrays.sort(i);
|
Arrays.sort(i);
|
||||||
return i[i.length - 1];
|
return i[i.length - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int min(int... i) {
|
private static char min(char... i) {
|
||||||
Arrays.sort(i);
|
Arrays.sort(i);
|
||||||
return i[0];
|
return i[0];
|
||||||
}
|
}
|
||||||
@@ -494,14 +497,14 @@ public class LightmapRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static int clampByte(int i) {
|
private static int clampByte(int i) {
|
||||||
return (i < 0) ? 0 : (i > 0xFF) ? 0xFF : i;
|
return (i < 0) ? 0 : (i > CHANNEL_MAX) ? CHANNEL_MAX : i;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int[][] getStaticLightMap() {
|
public static char[][] getStaticLightMap() {
|
||||||
return staticLightMap;
|
return staticLightMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getValueFromMap(int x, int y) {
|
public static char getValueFromMap(int x, int y) {
|
||||||
return staticLightMap[y][x];
|
return staticLightMap[y][x];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,9 +553,9 @@ public class LightmapRenderer {
|
|||||||
|
|
||||||
class LightmapLantern {
|
class LightmapLantern {
|
||||||
int x, y;
|
int x, y;
|
||||||
int intensity;
|
char intensity;
|
||||||
|
|
||||||
public LightmapLantern(int x, int y, int intensity) {
|
public LightmapLantern(int x, int y, char intensity) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
this.intensity = intensity;
|
this.intensity = intensity;
|
||||||
@@ -566,7 +569,7 @@ class LightmapLantern {
|
|||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getIntensity() {
|
public char getIntensity() {
|
||||||
return intensity;
|
return intensity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -892,11 +892,11 @@ public class MapGenerator {
|
|||||||
int thisTile = map.getTileFromTerrain(x, y);
|
int thisTile = map.getTileFromTerrain(x, y);
|
||||||
|
|
||||||
for (int i = 0; i < 9; i++) {
|
for (int i = 0; i < 9; i++) {
|
||||||
int nearbyTile = -1;
|
int nearbyWallTile = -1;
|
||||||
try { nearbyTile = map.getTileFromTerrain(x + (i / 3) - 1, y + (i % 3) - 1); }
|
try { nearbyWallTile = map.getTileFromWall(x + (i % 3) - 1, y + (i / 3) - 1); }
|
||||||
catch (ArrayIndexOutOfBoundsException e) {}
|
catch (ArrayIndexOutOfBoundsException e) {}
|
||||||
|
|
||||||
if (i != 4 && thisTile == DIRT && nearbyTile == AIR) {
|
if (i != 4 && thisTile == DIRT && nearbyWallTile == AIR) {
|
||||||
map.getTerrainArray()[y][x] = GRASS;
|
map.getTerrainArray()[y][x] = GRASS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import java.io.IOException;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import com.Torvald.ImageFont.GameFontBase;
|
||||||
import com.Torvald.ImageFont.GameFontWhite;
|
import com.Torvald.ImageFont.GameFontWhite;
|
||||||
import com.Torvald.Terrarum.ConsoleCommand.Authenticator;
|
import com.Torvald.Terrarum.ConsoleCommand.Authenticator;
|
||||||
import com.Torvald.Terrarum.LangPack.Lang;
|
import com.Torvald.Terrarum.LangPack.Lang;
|
||||||
@@ -42,7 +43,7 @@ public class Terrarum extends StateBasedGame {
|
|||||||
public static String defaultDir;
|
public static String defaultDir;
|
||||||
public static String defaultSaveDir;
|
public static String defaultSaveDir;
|
||||||
|
|
||||||
public static String gameLocale = "ko";
|
public static String gameLocale = "jp";
|
||||||
|
|
||||||
public static Font gameFontWhite;
|
public static Font gameFontWhite;
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class TileProp {
|
|||||||
|
|
||||||
private boolean wallable;
|
private boolean wallable;
|
||||||
|
|
||||||
private int luminosity;
|
private char luminosity;
|
||||||
private int drop;
|
private int drop;
|
||||||
|
|
||||||
private boolean fallable;
|
private boolean fallable;
|
||||||
@@ -94,7 +94,7 @@ public class TileProp {
|
|||||||
* Raw RGB value, without alpha
|
* Raw RGB value, without alpha
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public int getLuminosity() {
|
public char getLuminosity() {
|
||||||
return luminosity;
|
return luminosity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ public class TileProp {
|
|||||||
*
|
*
|
||||||
* @param luminosity Raw RGB value, without alpha
|
* @param luminosity Raw RGB value, without alpha
|
||||||
*/
|
*/
|
||||||
void setLuminosity(int luminosity) {
|
void setLuminosity(char luminosity) {
|
||||||
this.luminosity = luminosity;
|
this.luminosity = luminosity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,14 +49,18 @@ public class TilePropCodex {
|
|||||||
return tileProps[index];
|
return tileProps[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setProp(TileProp prop, CSVRecord record) {
|
public static byte getTileID(String name) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setProp(TileProp prop, CSVRecord record) {
|
||||||
prop.setName(record.get("name"));
|
prop.setName(record.get("name"));
|
||||||
|
|
||||||
prop.setId(intVal(record, "id"));
|
prop.setId(intVal(record, "id"));
|
||||||
|
|
||||||
prop.setOpacity(intVal(record, "opacity"));
|
prop.setOpacity(intVal(record, "opacity"));
|
||||||
prop.setStrength(intVal(record, "strength"));
|
prop.setStrength(intVal(record, "strength"));
|
||||||
prop.setLuminosity(intVal(record, "lumcolor"));
|
prop.setLuminosity((char) intVal(record, "lumcolor"));
|
||||||
prop.setDrop(intVal(record, "drop"));
|
prop.setDrop(intVal(record, "drop"));
|
||||||
prop.setFriction(intVal(record, "friction"));
|
prop.setFriction(intVal(record, "friction"));
|
||||||
|
|
||||||
@@ -71,11 +75,11 @@ public class TilePropCodex {
|
|||||||
System.out.println("\t" + prop.getName());
|
System.out.println("\t" + prop.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
private int intVal(CSVRecord rec, String s) {
|
private static int intVal(CSVRecord rec, String s) {
|
||||||
return Integer.decode(rec.get(s));
|
return Integer.decode(rec.get(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean boolVal(CSVRecord rec, String s) {
|
private static boolean boolVal(CSVRecord rec, String s) {
|
||||||
return !(intVal(rec, s) == 0);
|
return !(intVal(rec, s) == 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,46 +1,46 @@
|
|||||||
"id";"name" ;"opacity";"strength";"fluid";"viscosity";"solid";"wall";"lumcolor";"drop";"fall";"friction"
|
"id";"name" ;"opacity";"strength";"fluid";"viscosity";"solid";"wall";"lumcolor";"drop";"fall";"friction"
|
||||||
# Friction: 0: frictionless, <16: slippery, 16: regular, >16: sticky
|
# Friction: 0: frictionless, <16: slippery, 16: regular, >16: sticky
|
||||||
"0";"TILE_AIR" ; "4"; "0"; "0"; "N/A"; "0"; "0"; "0"; "0"; "0";"16"
|
"0";"TILE_AIR" ; "1"; "0"; "0"; "N/A"; "0"; "0"; "0"; "0"; "0";"16"
|
||||||
"1";"TILE_STONE" ; "32"; "25"; "0"; "N/A"; "1"; "1"; "0"; "1"; "0";"16"
|
"1";"TILE_STONE" ; "5"; "25"; "0"; "N/A"; "1"; "1"; "0"; "1"; "0";"16"
|
||||||
"2";"TILE_DIRT" ; "32"; "6"; "0"; "N/A"; "1"; "1"; "0"; "2"; "0";"16"
|
"2";"TILE_DIRT" ; "5"; "6"; "0"; "N/A"; "1"; "1"; "0"; "2"; "0";"16"
|
||||||
"3";"TILE_GRASS" ; "32"; "6"; "0"; "N/A"; "1"; "1"; "0"; "2"; "0";"16"
|
"3";"TILE_GRASS" ; "5"; "6"; "0"; "N/A"; "1"; "1"; "0"; "2"; "0";"16"
|
||||||
"4";"TILE_PLANK_NORMAL" ; "32"; "12"; "0"; "N/A"; "1"; "1"; "0"; "4"; "0";"16"
|
"4";"TILE_PLANK_NORMAL" ; "5"; "12"; "0"; "N/A"; "1"; "1"; "0"; "4"; "0";"16"
|
||||||
"5";"TILE_PLANK_EBONY" ; "32"; "12"; "0"; "N/A"; "1"; "1"; "0"; "5"; "0";"16"
|
"5";"TILE_PLANK_EBONY" ; "5"; "12"; "0"; "N/A"; "1"; "1"; "0"; "5"; "0";"16"
|
||||||
"6";"TILE_PLANK_BIRCH" ; "32"; "12"; "0"; "N/A"; "1"; "1"; "0"; "6"; "0";"16"
|
"6";"TILE_PLANK_BIRCH" ; "5"; "12"; "0"; "N/A"; "1"; "1"; "0"; "6"; "0";"16"
|
||||||
"7";"TILE_PLANK_BLOODROSE" ; "32"; "12"; "0"; "N/A"; "1"; "1"; "0"; "7"; "0";"16"
|
"7";"TILE_PLANK_BLOODROSE" ; "5"; "12"; "0"; "N/A"; "1"; "1"; "0"; "7"; "0";"16"
|
||||||
"8";"TILE_TRUNK_NORMAL" ; "32"; "12"; "0"; "N/A"; "1"; "0"; "0"; "8"; "0";"16"
|
"8";"TILE_TRUNK_NORMAL" ; "5"; "12"; "0"; "N/A"; "1"; "0"; "0"; "8"; "0";"16"
|
||||||
"9";"TILE_TRUNK_EBONY" ; "32"; "12"; "0"; "N/A"; "1"; "0"; "0"; "9"; "0";"16"
|
"9";"TILE_TRUNK_EBONY" ; "5"; "12"; "0"; "N/A"; "1"; "0"; "0"; "9"; "0";"16"
|
||||||
"10";"TILE_TRUNK_BIRCH" ; "32"; "12"; "0"; "N/A"; "1"; "0"; "0"; "10"; "0";"16"
|
"10";"TILE_TRUNK_BIRCH" ; "5"; "12"; "0"; "N/A"; "1"; "0"; "0"; "10"; "0";"16"
|
||||||
"11";"TILE_TRUNK_BLOODROSE" ; "32"; "12"; "0"; "N/A"; "1"; "0"; "0"; "11"; "0";"16"
|
"11";"TILE_TRUNK_BLOODROSE" ; "5"; "12"; "0"; "N/A"; "1"; "0"; "0"; "11"; "0";"16"
|
||||||
"12";"TILE_STONE" ; "32"; "25"; "0"; "N/A"; "1"; "1"; "0"; "12"; "0";"16"
|
"12";"TILE_STONE" ; "5"; "25"; "0"; "N/A"; "1"; "1"; "0"; "12"; "0";"16"
|
||||||
"13";"TILE_SAND" ; "32"; "6"; "0"; "N/A"; "1"; "1"; "0"; "13"; "1";"16"
|
"13";"TILE_SAND" ; "5"; "6"; "0"; "N/A"; "1"; "1"; "0"; "13"; "1";"16"
|
||||||
"14";"TILE_GRAVEL" ; "32"; "6"; "0"; "N/A"; "1"; "0"; "0"; "14"; "1";"16"
|
"14";"TILE_GRAVEL" ; "5"; "6"; "0"; "N/A"; "1"; "0"; "0"; "14"; "1";"16"
|
||||||
|
|
||||||
"15";"TILE_ORE_MALACHITE" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "15"; "0";"16"
|
"15";"TILE_ORE_MALACHITE" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "15"; "0";"16"
|
||||||
"16";"TILE_ORE_HEMATITE" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "16"; "0";"16"
|
"16";"TILE_ORE_HEMATITE" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "16"; "0";"16"
|
||||||
"17";"TILE_ORE_NATURAL_GOLD" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "17"; "0";"16"
|
"17";"TILE_ORE_NATURAL_GOLD" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "17"; "0";"16"
|
||||||
"18";"TILE_ORE_NATURAL_SILVER" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "18"; "0";"16"
|
"18";"TILE_ORE_NATURAL_SILVER" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "18"; "0";"16"
|
||||||
"19";"TILE_ORE_RUTILE" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "19"; "0";"16"
|
"19";"TILE_ORE_RUTILE" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "19"; "0";"16"
|
||||||
"20";"TILE_ORE_AURICHALCUMITE" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "20"; "0";"16"
|
"20";"TILE_ORE_AURICHALCUMITE" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "20"; "0";"16"
|
||||||
"21";"TILE_GEM_RUBY" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "21"; "0";"16"
|
"21";"TILE_GEM_RUBY" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "21"; "0";"16"
|
||||||
"22";"TILE_GEM_EMERALD" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "22"; "0";"16"
|
"22";"TILE_GEM_EMERALD" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "22"; "0";"16"
|
||||||
"23";"TILE_GEM_SAPPHIRE" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "23"; "0";"16"
|
"23";"TILE_GEM_SAPPHIRE" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "23"; "0";"16"
|
||||||
"24";"TILE_GEM_TOPAZ" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "24"; "0";"16"
|
"24";"TILE_GEM_TOPAZ" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "24"; "0";"16"
|
||||||
"25";"TILE_GEM_DIAMOND" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "25"; "0";"16"
|
"25";"TILE_GEM_DIAMOND" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "25"; "0";"16"
|
||||||
"26";"TILE_GEM_AMETHYST" ; "32"; "25"; "0"; "N/A"; "1"; "0"; "0"; "26"; "0";"16"
|
"26";"TILE_GEM_AMETHYST" ; "5"; "25"; "0"; "N/A"; "1"; "0"; "0"; "26"; "0";"16"
|
||||||
|
|
||||||
"27";"TILE_SNOW" ; "32"; "6"; "0"; "N/A"; "1"; "1"; "0"; "27"; "0";"16"
|
"27";"TILE_SNOW" ; "5"; "6"; "0"; "N/A"; "1"; "1"; "0"; "27"; "0";"16"
|
||||||
"28";"TILE_ICE_FRAGILE" ; "8"; "1"; "0"; "N/A"; "1"; "0"; "0"; "28"; "0";"16"
|
"28";"TILE_ICE_FRAGILE" ; "2"; "1"; "0"; "N/A"; "1"; "0"; "0"; "28"; "0";"16"
|
||||||
"29";"TILE_ICE_NATURAL" ; "24"; "25"; "0"; "N/A"; "1"; "1"; "0"; "29"; "0"; "8"
|
"29";"TILE_ICE_NATURAL" ; "4"; "25"; "0"; "N/A"; "1"; "1"; "0"; "29"; "0"; "8"
|
||||||
"30";"TILE_ICE_CLEAR_MAGICAL" ; "32"; "25"; "0"; "N/A"; "1"; "1"; "855567"; "30"; "0"; "8"
|
"30";"TILE_ICE_CLEAR_MAGICAL" ; "5"; "25"; "0"; "N/A"; "1"; "1"; "4967"; "30"; "0"; "8"
|
||||||
# see scandinavian name set female of this tile id!
|
# see scandinavian name set female of this tile id!
|
||||||
"31";"TILE_PLATFORM_STONE" ; "2"; "0"; "0"; "N/A"; "0"; "0"; "0"; "31"; "0";"16"
|
"31";"TILE_PLATFORM_STONE" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "31"; "0";"16"
|
||||||
"32";"TILE_PLATFORM_WOODEN" ; "2"; "0"; "0"; "N/A"; "0"; "0"; "0"; "32"; "0";"16"
|
"32";"TILE_PLATFORM_WOODEN" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "32"; "0";"16"
|
||||||
"33";"TILE_PLATFORM_EBONY" ; "2"; "0"; "0"; "N/A"; "0"; "0"; "0"; "33"; "0";"16"
|
"33";"TILE_PLATFORM_EBONY" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "33"; "0";"16"
|
||||||
"34";"TILE_PLATFORM_BIRCH" ; "2"; "0"; "0"; "N/A"; "0"; "0"; "0"; "34"; "0";"16"
|
"34";"TILE_PLATFORM_BIRCH" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "34"; "0";"16"
|
||||||
"35";"TILE_PLATFORM_BLOODROSE" ; "2"; "0"; "0"; "N/A"; "0"; "0"; "0"; "35"; "0";"16"
|
"35";"TILE_PLATFORM_BLOODROSE" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "35"; "0";"16"
|
||||||
|
|
||||||
"36";"TILE_TORCH" ; "0"; "0"; "0"; "N/A"; "0"; "0";"16769997"; "36"; "0";"16"
|
"36";"TILE_TORCH" ; "0"; "0"; "0"; "N/A"; "0"; "0";"63680"; "36"; "0";"16"
|
||||||
|
|
||||||
"239";"TILE_WATER" ; "16"; "100"; "1"; "2"; "0"; "0";"15464447"; "239"; "0";"16"
|
"239";"TILE_WATER" ; "2"; "100"; "1"; "2"; "0"; "0";"59159"; "239"; "0";"16"
|
||||||
"255";"TILE_LAVA" ; "0"; "100"; "1"; "2"; "0"; "0"; "8397312"; "239"; "0";"16"
|
"255";"TILE_LAVA" ; "0"; "100"; "1"; "2"; "0"; "0";"48320"; "239"; "0";"16"
|
||||||
|
|||||||
|
Can't render this file because it contains an unexpected character in line 1 and column 12.
|
@@ -83,7 +83,14 @@ public class BasicDebugInfoWindow implements UICanvas {
|
|||||||
|
|
||||||
String lightVal;
|
String lightVal;
|
||||||
try {
|
try {
|
||||||
lightVal = Integer.toHexString(LightmapRenderer.getValueFromMap(mouseTileX, mouseTileY)).toUpperCase();
|
char valRaw = LightmapRenderer.getValueFromMap(mouseTileX, mouseTileY);
|
||||||
|
int rawR = LightmapRenderer.getRawR(valRaw);
|
||||||
|
int rawG = LightmapRenderer.getRawG(valRaw);
|
||||||
|
int rawB = LightmapRenderer.getRawB(valRaw);
|
||||||
|
lightVal = String.valueOf((int)valRaw) + " ("
|
||||||
|
+ String.valueOf(rawR) + " "
|
||||||
|
+ String.valueOf(rawG) + " "
|
||||||
|
+ String.valueOf(rawB) + ")";
|
||||||
}
|
}
|
||||||
catch (ArrayIndexOutOfBoundsException e) {
|
catch (ArrayIndexOutOfBoundsException e) {
|
||||||
lightVal = "out of bounds";
|
lightVal = "out of bounds";
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ public class ConsoleWindow implements UICanvas {
|
|||||||
prevCommand = "";
|
prevCommand = "";
|
||||||
commandInputPool = new StringBuffer();
|
commandInputPool = new StringBuffer();
|
||||||
|
|
||||||
if (Terrarum.game.auth.C()) sendMessage(Lang.get("DEV_MESSAGE_CONSOLE_CODEX"));
|
if (Terrarum.game.auth.b()) sendMessage(Lang.get("DEV_MESSAGE_CONSOLE_CODEX"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user