Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Factions = {}
- local Power = 0
- local Characters = {}
- local Structure = {}
- local Balance = 0
- local w, h = term.getSize()
- local function Clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function RNG_Names(type)
- local Names = {}
- local Contents
- if Type == "character" then
- local F = fs.open("os/SystemFiles/WonderIsland.cpf/data/Names_C.txt","r")
- repeat
- Content = F.readLine()
- Names[#Names + 1] = Content
- until Content == nil
- F.close()
- elseif type == "faction" then
- local F = fs.open("os/SystemFiles/WonderIsland.cpf/data/Names_F.txt","r")
- repeat
- Content = F.readLine()
- Names[#Names + 1] = Content
- until Content == nil
- F.close()
- end
- return Names[math.random(1,3)]
- end
- function CreateCharacter(faction)
- local I = #Characters + 1
- local Name = RNG_Names("character")
- local Age = math.random(18,50)
- local Cash = math.random(0,99999)
- local Traits = {}
- Characters[I] = {Name,faction,Age,Cash,Traits}
- return I
- end
- function CreateRNGFaction()
- local I = #Factions + 1
- local Name = RNG_Names("faction")
- local Leader = CreateCharacter(I)
- local Supports = {"Mil3","Ind"}
- local Against = {"Pup","Elc"}
- Factions[I] = {Name,Leader,{Leader},Supports,Against}
- return I
- end
- function Prompt(text)
- paintutils.drawFilledBox(1,4,16,8,colors.lightGray)
- term.setCursorPos(1,4)
- print(text)
- term.setCursorPos(6,8)
- term.write("continue")
- repeat
- local a, b, c, d = os.pullEvent("mouse_click")
- until c >= 6 and c <= 15 and d == 8
- end
- function Event(id)
- if id == 1 then--new faction is created
- local I = CreateRNGFaction()
- Prompt("new Faction has appeared! the "..Factions[I][1].." lead by "..Characters[Factions[I][2]][1].." may seek to replace you!")
- end
- end
- Event(1)
Add Comment
Please, Sign In to add comment