Page 1 of 1

Apeman RPG

Posted: Mon Oct 16, 2017 3:43 pm
by NTech
This is a mud-like game I am working on. Check it out.

Improvements to be made:
-Make some skills work
-Add some skills
-Anything you want

Please post your improvements, I look forward to seeing them. I will
refresh it every once in a while with my current version. -Ntech

Code: Select all

'
' Apeman
'
'
'Current Notes: Need to implement the skills.
' Skills Implemented: Improved Fighting Technique, Stamina, Heal
'
' By Ntech. Please post your improvements.

global life,energy,animal$ 'your life, your energy, and the animal your fighting if present
global com$ 'command
global animalLife, animalAttack, yourAttack, battlePoints 'for fighting the animals

dim inventory$(5) 'the inventory, can be gotten by getting the skill 'gather'
inventory$(1) = ""
inventory$(2) = ""
inventory$(3) = ""
inventory$(4) = ""
inventory$(5) = ""

dim knownSkills$(5,5) 'known skills, and wether or not they are learnt
knownSkills$(1,1) = "Make" 'make stuff; makes you fight better
knownSkills$(2,1) = "Gather" 'gather food;unlocks inventory
knownSkills$(3,1) = "Heal" 'heal yourself on the field of battle
knownSkills$(4,1) = "Stamina" 'moving now costs you 5 energy instead of 10
knownSkills$(5,1) = "Improved Fighting Techniques" 'you now attack better

knownSkills$(1,2) = "0"
knownSkills$(2,2) = "0"
knownSkills$(3,2) = "0"
knownSkills$(4,2) = "0"
knownSkills$(5,2) = "0"

FoodCondition$(1) = "juicy"
FoodCondition$(2) = "crunchy"

print
print "Apeman: An Epic Quest For Survival"
print
input ">";e$
cls

print
print "What is your name?"
input ">";name$
cls

life = 100
energy = 100

[startSquare]
if knownSkills$(3,2) = "1" then life = life + 5
if life > 100 then life = 100
print
print "Name: ";name$
print "Energy: ";energy
print "Health: ";life;"/100"
print "*********************"
if battlePoints < 1 then print "Commands: look, eat"
if battlePoints then print "Commands: look, eat, learn"
print
print "Exits: N(orth)"
print
input ">";com$
cls

if upper$(com$) = "N" then

    if knownSkills$(4,2) <> "1" then
        if energy > 9 then
        energy = energy - 10
        goto [homeSquare]
        end if

        if energy > 9 then
        print "You are too tired."
        input ">";e$
        cls
        goto [startSquare]
        end if
    end if

    if knownSkills$(4,2) = "1" then
        if energy > 6 then
        energy = energy - 5
        goto [homeSquare]
        end if

        if energy > 5 then
        print "You are too tired."
        input ">";e$
        cls
        goto [startSquare]
        end if
    end if
end if

if upper$(com$) = "LOOK" then
    print "You see a big plain."
    print "It is intersparsed with brown clumps,"
    print "which you have learned to eat."
    input ">";e$
    cls
    goto [startSquare]
end if

if upper$(com$) = "EAT" then
condition = int(rnd(1)*2)+1
    print "You eat the brown clumps."
    print "They are rather ";FoodCondition$(condition);" today."
    print
    input ">";e$ 
    if energy < 100 then energy = energy + 5
    if energy > 100 then energy = 100
    if life < 100 then life = life + 5
    if life > 100 then life = 100
    cls
    goto [startSquare]
end if
if upper$(com$) = "LEARN" then
    if battlePoints then
    gosub [learn]
    cls
    end if
end if

cls
goto [startSquare]


[homeSquare]
if knownSkills$(3,2) = "1" then life = life + 5
if life > 100 then life = 100
gosub [setAnimal]
print
print "Name: ";name$
print "Energy: ";energy
print "Health: ";life;"/100"
print "*********************"
if battlePoints < 1 then print "Commands: look, fight"
if battlePoints then print "Commands: look, fight, learn"
print
print "There is a ";animal$;" here."
print
print "Exits: S(outh)"
print
input ">";com$
cls

if upper$(com$) = "S" then

    if knownSkills$(4,2) <> "1" then
        if energy > 9 then
        energy = energy - 10
        goto [startSquare]
        end if

        if energy > 9 then
        print "You are too tired."
        input ">";e$
        cls
        goto [homeSquare]
        end if
    end if

    if knownSkills$(4,2) = "1" then
        if energy > 6 then
        energy = energy - 5
        goto [startSquare]
        end if

        if energy > 5 then
        print "You are too tired."
        input ">";e$
        cls
        goto [homeSquare]
        end if
    end if
end if

if upper$(com$) = "LOOK" then
    print "You see a big plain."
    print "There is a ";animal$;" here."
    print
    input ">";e$
    cls
    goto [homeSquare]
end if

if upper$(com$) = "FIGHT" then
    gosub [fight]
    cls
    goto [homeSquare]
end if

if upper$(com$) = "LEARN" then
    if battlePoints then
    gosub [learn]
    cls
    end if
end if

cls
goto [homeSquare]

[setAnimal]
randomAnimal = int(rnd(1)*2)+1

if randomAnimal = 1 then animal$ = "wild bird"
if randomAnimal = 2 then animal$ = "ferocious chipmunk"

RETURN

[fight]
cls
animalLife = 100

[fightLoop]
cls
animalAttack = int(rnd(1)*3) + 1
if knownSkills$(5,2) <> "1" then yourAttack = int(rnd(1)*10) + 1
if knownSkills$(5,2) =  "1" then yourAttack = int(rnd(1)*20) + 1

life = life - animalAttack
print "The ";animal$;" attacks you for ";animalAttack;" damage."
print "(";life;"/100 HP) Enemy ";animalLife;"% >"
input ">";e$
cls

if life < 1 then
print "You were killed by a ";animal$
print
input ">";e$
cls
end
end if

animalLife = animalLife - yourAttack
print "You attack the ";animal$;" for ";yourAttack;" damage."
print "(";life;"/100 HP) Enemy ";animalLife;"% >"
input ">";e$
cls

if animalLife < 1 then
battlePoints = battlePoints + 1
print "You have killed a ";animal$;"!"
input ">";e$
cls

RETURN
end if

goto [fightLoop]

wait

[learn]

'dim knownSkills$(5,5) 'known skills, and wether or not they are learnt
'knownSkills$(1,1) = "Make" 'make stuff; makes you fight better
'knownSkills$(2,1) = "Gather" 'gather food;unlocks inventory
'knownSkills$(3,1) = "Heal" 'heal yourself on the field of battle
'knownSkills$(4,1) = "Stamina" 'moving now costs you 2 energy instead of 5
'knownSkills$(5,1) = "Improved Fighting Techniques" 'you now attack better

print "==CORE SKILLS=="
if knownSkills$(1,2) = "1" then print "(X) Make (not operational)"
if knownSkills$(1,2) <> "1" then print "( ) Make (not operational)"

if knownSkills$(2,2) = "1" then print "(X) Gather (not operational)"
if knownSkills$(2,2) <> "1" then print "( ) Gather (not operational)"

if knownSkills$(3,2) = "1" then print "(X) Heal"
if knownSkills$(3,2) <> "1" then print "( ) Heal"

if knownSkills$(4,2) = "1" then print "(X) Stamina"
if knownSkills$(4,2) <> "1" then print "( ) Stamina"

if knownSkills$(5,2) = "1" then print "(X) Improved Fighting Technique"
if knownSkills$(5,2) <> "1" then print "( ) Improved Fighting Technique"

print
print "You have ";battlePoints;" skill upgrades to spend."
print
print "Commands: skill buy <skill>"
print
input ">";com$
cls

if upper$(com$) = "SKILL BUY MAKE" then
battlePoints = battlePoints - 1
knownSkills$(1,2) = "1"
end if

if upper$(com$) = "SKILL BUY GATHER" then
battlePoints = battlePoints - 1
knownSkills$(2,2) = "1"
end if

if upper$(com$) = "SKILL BUY HEAL" then
battlePoints = battlePoints - 1
knownSkills$(3,2) = "1"
end if

if upper$(com$) = "SKILL BUY STAMINA" then
battlePoints = battlePoints - 1
knownSkills$(4,2) = "1"
end if

if upper$(com$) = "SKILL BUY IMPROVED FIGHTING TECHNIQUE" then
battlePoints = battlePoints - 1
knownSkills$(5,2) = "1"
end if

RETURN