Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from raku2wei/feature/add-enemy-and-battle
敵と戦闘シーンを追加
- Loading branch information
Showing
11 changed files
with
444 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
一刀両断 | ||
ittouryoudann | ||
右往左往 | ||
uousaou | ||
疑心暗鬼 | ||
gisinnannki | ||
危機一髪 | ||
kikiippatu | ||
弱肉強食 | ||
jyakunikukyousyoku | ||
正々堂々 | ||
seiseidoudou | ||
自問自答 | ||
jimonnjitou | ||
変幻自在 | ||
henngennjizai | ||
油断大敵 | ||
yudanntaiteki | ||
勇猛果敢 | ||
yuumoukakann | ||
猪突猛進 | ||
tyototumousinn | ||
上杉謙信 | ||
uesugikennsinn | ||
真田幸村 | ||
sanadayukimura | ||
伊達正宗 | ||
datemasamune | ||
豊臣秀吉 | ||
toyotomihideyosi | ||
武田信玄 | ||
takedasinngenn | ||
織田信長 | ||
odanobunaga | ||
葛飾北斎 | ||
katusikahokusai | ||
夏目漱石 | ||
natumesouseki | ||
福沢諭吉 | ||
fukuzawayukiti | ||
宮本武蔵 | ||
miyamotomusasi | ||
岡本太郎 | ||
okamototarou | ||
石の上にも三年 | ||
isinouenimosannnenn | ||
石橋を叩いて渡る | ||
isibasiwotataitewataru | ||
馬の耳に念仏 | ||
umanomimininennbutu | ||
縁の下の力持ち | ||
ennnositanotikaramoti | ||
鬼の目にも涙 | ||
oninomenimonamida | ||
花より団子 | ||
hanayoridanngo | ||
焼け石に水 | ||
yakeisinimizu | ||
目の上のたんこぶ | ||
menouenotannkobu | ||
隣の花は赤い | ||
tonarinohanahaakai | ||
猫に小判 | ||
nekonikobann | ||
猿も木から落ちる | ||
sarumokikaraotiru | ||
以心伝心 | ||
isinndennsinn | ||
石橋を叩く | ||
isibasiwotataku | ||
急がば回れ | ||
isogabamaware | ||
馬の耳に念仏 | ||
umanomimininennbutu | ||
噂をすれば影 | ||
uwasawosurebakage | ||
猿も木から落ちる | ||
sarumokikaraotiru | ||
策士策に溺れる | ||
sakusisakunioboreru | ||
青天の霹靂 | ||
seitennnohekireki | ||
短気は損気 | ||
tannkihasonnki | ||
敵に塩を送る | ||
tekinisiowookuru | ||
破竹の勢い | ||
hatikunoikioi | ||
類は友を呼ぶ | ||
ruihatomowoyobu | ||
ジャイアントパンダ | ||
jyaianntopannda | ||
タスマニアデビル | ||
tasumaniadebiru | ||
ガラパゴスゾウガメ | ||
garapagosuzougame | ||
コモドオオトカゲ | ||
komodoootokage | ||
ホッキョクグマ | ||
hokkyokuguma | ||
ヤンバルクイナ | ||
yannbarukuina | ||
アメリカバイソン | ||
amerikabaisonn | ||
マウンテンゴリラ | ||
maunntenngorira | ||
マッコウクジラ | ||
makkoukujira | ||
皇帝ペンギン | ||
kouteipennginn | ||
エリマキトカゲ | ||
erimakitokage |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
∧ ∧ | ||
( ・ω・) | ||
⊂ ⊃ | ||
| | | ||
∪ ̄∪ | ||
|
||
|
This file contains 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package dungeon | ||
|
||
import ( | ||
"math/rand" | ||
) | ||
|
||
const ( | ||
// エンカウント率のデフォルト値:10% | ||
DefaultEncounterRate float32 = 10.0 | ||
// エンカウント率の増加率:移動するごとに1.4倍 | ||
EncounterIncreaseRate float32 = 1.4 | ||
) | ||
|
||
// 敵とのエンカウント処理 | ||
func (d *Dungeon) checkEncounter() bool { | ||
randomNumber := rand.Intn(100) + 1 | ||
return float32(randomNumber) <= d.encounterRate | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package enemy | ||
|
||
import ( | ||
"fmt" | ||
"jailbreak/pkg/system" | ||
"math/rand" | ||
) | ||
|
||
const typingTextFilePath = "assets/battle/keibi.txt" | ||
|
||
type Enemy struct { | ||
Name string | ||
FilePath string | ||
TextJapanese string | ||
TextRomaji string | ||
} | ||
|
||
func NewEnemy(name string, path string) *Enemy { | ||
line := 2 * (rand.Intn(56)) + 1 // ランダムで奇数行を選択 | ||
textJapanese := system.LoadLineText(typingTextFilePath, line) | ||
textRomaji := system.LoadLineText(typingTextFilePath, line + 1) | ||
return &Enemy{Name: name, FilePath: path, TextJapanese: textJapanese, TextRomaji: textRomaji} | ||
} | ||
|
||
func (n *Enemy) Display() { | ||
system.PrintFile(n.FilePath) | ||
} | ||
|
||
func (n *Enemy) PrintTypingText() { | ||
fmt.Println(n.TextJapanese) | ||
fmt.Println(n.TextRomaji) | ||
} |
Oops, something went wrong.