Skip to content

Commit

Permalink
give invok
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Gatto <uso.cosmo.ray@gmail.com>
  • Loading branch information
cosmo-ray committed Dec 21, 2023
1 parent dbae75d commit ebb48f6
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 16 deletions.
14 changes: 14 additions & 0 deletions actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,20 @@ function npcDefaultInit(npc, enemy_type)
return npc
end

function give_invok(_wid_, _eve_, invok_name)
local invoks = yeTryCreateArray(phq.pj, "invok")
invok_name = yeGetString(invok_name)
invoks = Entity.wrapp(invoks)

print(invok)
print("in give invock !!")
if yIsNNil(yeGet(invoks, invok_name)) then
return
end
printMessage(main_widget, nil, "Got new invock: " .. invok_name)
yePushBack(invoks, npcs[invok_name], invok_name)
end

function StartFight(wid, eve, enemy_type, script)
local main = getMainWid(wid)
local fWid = Entity.new_array()
Expand Down
1 change: 0 additions & 1 deletion dialogue/bar_dialogue.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
}
}
},

"Jean": {
"dialogue" : [
{
Expand Down
15 changes: 15 additions & 0 deletions global_menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ function pushSTatusTextScreen(container)
local knowledge = phq.pj.knowledge
local stats_str = "----- Stats -----\n"
local stats = phq.pj.stats
local invocks = phq.pj.invok
local invocks_str = "" -- "----- Invoks -----\n"
local trait_str = "----- Trait -----\n"
local trait = phq.pj.trait
local cmb_str = "-[Currrent Fighting Skill: {phq.pj.attack}]-\n"
Expand Down Expand Up @@ -204,6 +206,18 @@ function pushSTatusTextScreen(container)
end
i = i + 1
end
if yIsNNil(invocks) then
invocks_str = "----- Invoks -----\n"
i = 0
while i < yeLen(invocks) do
if invocks[i] then
local invocks_k = yeGetKeyAt(invocks, i)
invocks_str = invocks_str .. invocks_k .. ""
end
i = i + 1
end
invocks_str = invocks_str .. "\n"
end

local chap_txt = "capter: "

Expand Down Expand Up @@ -248,6 +262,7 @@ function pushSTatusTextScreen(container)
"Status:\n" ..
"life: {phq.pj.life}\n" ..
"xp: {phq.pj.xp} \n" ..
invocks_str ..
alcohol_lvl_str() ..
knowledge_str ..
stats_str ..
Expand Down
1 change: 1 addition & 0 deletions npcs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"Thrug": {
"sex": "male",
"type": "light",
"name": "Thrug",
"max_life": 13,
"is_generic": true,
"hair": ["plain", "raven"],
Expand Down
1 change: 1 addition & 0 deletions phq.lua
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ function init_phq(mod)
mod.scene_ai.random_movements = Entity.new_func(randomMovements)
mod.misc_fnc = {}
mod.misc_fnc.move_npc = Entity.new_func(move_npc)
mod.misc_fnc.give_invok = Entity.new_func(give_invok)
mod.misc_fnc.unmove_npc = Entity.new_func(unmove_npc)
mod.misc_fnc.give_neutral_quest = Entity.new_func(give_neutral_quest)
mod.misc_fnc.class_even = Entity.new_func(calsses_event_dialog_gen)
Expand Down
57 changes: 42 additions & 15 deletions tileset/bar1.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@
"name":"Entries",
"objects":[
{
"class":"EntryPoint",
"height":25,
"id":19,
"name":"To Street",
Expand All @@ -211,6 +210,7 @@
"value":"up"
}],
"rotation":0,
"type":"EntryPoint",
"visible":true,
"width":25,
"x":644,
Expand All @@ -228,7 +228,6 @@
"name":"Actionable",
"objects":[
{
"class":"",
"height":30,
"id":29,
"name":"underground",
Expand All @@ -249,10 +248,38 @@
"value":"bar_underground"
}],
"rotation":0,
"type":"",
"visible":true,
"width":31,
"x":96.5,
"y":100
},
{
"height":37.5760117425037,
"id":39,
"name":"thrug-invok",
"properties":[
{
"name":"Action",
"type":"string",
"value":"phq.misc_fnc.give_invok"
},
{
"name":"ActionNbArgs",
"type":"int",
"value":1
},
{
"name":"Arg0",
"type":"string",
"value":"Thrug"
}],
"rotation":0,
"type":"",
"visible":true,
"width":32.2080100650032,
"x":161.040050325016,
"y":278.062486894527
}],
"opacity":1,
"type":"objectgroup",
Expand All @@ -266,7 +293,6 @@
"name":"NPC",
"objects":[
{
"class":"NPC",
"height":0,
"id":1,
"name":"Robert",
Expand All @@ -278,13 +304,13 @@
"value":"right"
}],
"rotation":0,
"type":"NPC",
"visible":true,
"width":0,
"x":110,
"y":271
},
{
"class":"",
"height":0,
"id":30,
"name":"Jean",
Expand All @@ -296,13 +322,13 @@
"value":"left"
}],
"rotation":0,
"type":"",
"visible":true,
"width":0,
"x":179.207920792079,
"y":402.970297029703
},
{
"class":"",
"height":0,
"id":31,
"name":"Herru",
Expand All @@ -314,13 +340,13 @@
"value":"left"
}],
"rotation":0,
"type":"",
"visible":true,
"width":0,
"x":175.653013037676,
"y":176.546658453958
},
{
"class":"",
"height":0,
"id":32,
"name":"Will",
Expand All @@ -332,13 +358,13 @@
"value":"left"
}],
"rotation":0,
"type":"",
"visible":true,
"width":0,
"x":463.799542223828,
"y":145.765570413203
},
{
"class":"",
"height":0,
"id":33,
"name":"Willo",
Expand All @@ -350,13 +376,13 @@
"value":"right"
}],
"rotation":0,
"type":"",
"visible":true,
"width":0,
"x":371.039633779063,
"y":138.537525599326
},
{
"class":"",
"height":0,
"id":34,
"name":"Harri",
Expand All @@ -378,13 +404,13 @@
"value":"phq.env.ha_need_party"
}],
"rotation":0,
"type":"",
"visible":true,
"width":0,
"x":368.63028550777,
"y":185.519816889531
},
{
"class":"",
"height":0,
"id":35,
"name":"Baffy",
Expand All @@ -396,13 +422,13 @@
"value":"left"
}],
"rotation":0,
"type":"",
"visible":true,
"width":0,
"x":463.799542223828,
"y":185.519816889531
},
{
"class":"",
"height":0,
"id":36,
"name":"random_boy_bar",
Expand All @@ -414,13 +440,13 @@
"value":"left"
}],
"rotation":0,
"type":"",
"visible":true,
"width":0,
"x":467.016145942546,
"y":270.547284546026
},
{
"class":"",
"height":0,
"id":37,
"name":"random_boy_bar",
Expand All @@ -432,13 +458,13 @@
"value":"left"
}],
"rotation":0,
"type":"",
"visible":true,
"width":0,
"x":464.868945271545,
"y":305.97609561753
},
{
"class":"",
"height":0,
"id":38,
"name":"random_girl_bar",
Expand All @@ -450,6 +476,7 @@
"value":"right"
}],
"rotation":0,
"type":"",
"visible":true,
"width":0,
"x":366.097714405536,
Expand All @@ -462,10 +489,10 @@
"y":0
}],
"nextlayerid":9,
"nextobjectid":39,
"nextobjectid":41,
"orientation":"orthogonal",
"renderorder":"right-down",
"tiledversion":"1.9.2",
"tiledversion":"1.10.1",
"tileheight":32,
"tilesets":[
{
Expand All @@ -486,6 +513,6 @@
}],
"tilewidth":32,
"type":"map",
"version":"1.9",
"version":"1.10",
"width":24
}

0 comments on commit ebb48f6

Please sign in to comment.