Преглед изворни кода

Added shop north of the square.

master
Samuel Dweller пре 3 година
родитељ
комит
e0dc3e5dae
1 измењених фајлова са 95 додато и 0 уклоњено
  1. +95
    -0
      src/game/maps/Newtown.ts

+ 95
- 0
src/game/maps/Newtown.ts Прегледај датотеку

@@ -244,6 +244,100 @@ export const Newtown = (): Place => {
)
)

northTownShop.choices.push(
new Choice(
"Buy a shiny rock",
"This rock has no use.",
(world, executor) => {
if (executor.wallet.Gold >= 500) {
executor.wallet.Gold -= 500
executor.items.push(
new Items.KeyItem(new ProperNoun("Shiny Rock"), "Very shiny")
)

return new LogLine(`You buy a shiny rock`)
} else {
return new LogLine(`Shiny rocks are 500 gold coins, loser!`)
}
}
)
)
northTownShop.choices.push(
new Choice(
"Buy a health potion",
"50 Gold",
(world, executor) => {
if (executor.wallet.Gold >= 50) {
executor.wallet.Gold -= 50
executor.items.push(
new Items.HealthPotion()
)

return new LogLine(`You buy a health potion.`)
} else {
return new LogLine(`Health potions are 50 gold coins.`)
}
}
)
)

northTownShop.choices.push(
new Choice(
"Buy a strength potion",
"40 Gold",
(world, executor) => {
if (executor.wallet.Gold >= 40) {
executor.wallet.Gold -= 40
executor.items.push(
new Items.StrengthPotion()
)

return new LogLine(`You buy a strength potion.`)
} else {
return new LogLine(`Strength potions are 40 gold coins.`)
}
}
)
)

northTownShop.choices.push(
new Choice(
"Buy an acid potion",
"25 Gold",
(world, executor) => {
if (executor.wallet.Gold >= 25) {
executor.wallet.Gold -= 25
executor.items.push(
new Items.AcidPotion()
)

return new LogLine(`You buy an acid potion.`)
} else {
return new LogLine(`Acid potions are 25 gold coins.`)
}
}
)
)

northTownShop.choices.push(
new Choice(
"Buy a shrink potion",
"10 Gold",
(world, executor) => {
if (executor.wallet.Gold >= 10) {
executor.wallet.Gold -= 10
executor.items.push(
new Items.ShrinkPotion()
)

return new LogLine(`You buy a shrink potion.`)
} else {
return new LogLine(`Shrink potions are 10 gold coins.`)
}
}
)
)

debug.choices.push(
new Choice(
"Cut stats",
@@ -397,6 +491,7 @@ export const Newtown = (): Place => {
townSquare.biconnect(Direction.East, eastTownStreet, "Walk", "Go that way", "Walk", "Go that way")
townSquare.biconnect(Direction.South, southTownStreet, "Walk", "Go that way", "Walk", "Go that way")
townSquare.biconnect(Direction.West, westTownStreet, "Walk", "Go that way", "Walk", "Go that way")
northTownShop.biconnect(Direction.West, northTownStreet, "Exit", "Leave the shop", "Enter", "Enter the shop")
debug.biconnect(Direction.South, bosses, "Enter", "Boss Fight!", "Leave", "Go back to the debug room")
eastTownStreet.biconnect(Direction.East, eastGate, "Walk", "Go that way", "Walk", "Go that way")
eastGate.biconnect(Direction.East, woods, "Walk", "Enter the woods", "Approach", "Enter the city gates")


Loading…
Откажи
Сачувај