Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tales of MajEyal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Otowa Kotori
Tales of MajEyal
Commits
ae783a7e
Commit
ae783a7e
authored
8 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
Near Sighted challenge
parent
2e388f46
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
game/modules/tome/class/Game.lua
+18
-7
18 additions, 7 deletions
game/modules/tome/class/Game.lua
game/modules/tome/class/GameState.lua
+21
-6
21 additions, 6 deletions
game/modules/tome/class/GameState.lua
with
39 additions
and
13 deletions
game/modules/tome/class/Game.lua
+
18
−
7
View file @
ae783a7e
...
...
@@ -1819,15 +1819,26 @@ function _M:setupCommands()
print
(
"==============="
)
end
end
,
[{
"_g"
,
"ctrl"
}]
=
function
()
if
config
.
settings
.
cheat
then
for
i
in
pairs
{
"iron longsword"
,
"steel longsword"
,
"dwarven-steel longsword"
,
"stralite longsword"
,
"voratun longsword"
,
}
do
local
o
=
game
.
zone
:
makeEntity
(
game
.
level
,
"object"
,
{
name
=
i
},
nil
,
true
)
if
o
then
o
:
identify
(
true
)
game
.
zone
:
addEntity
(
game
.
level
,
o
,
"object"
,
game
.
player
.
x
,
game
.
player
.
y
-
1
)
local
list
=
{}
local
loaded
=
{}
for
i
,
file
in
ipairs
{
"/data/general/objects/objects-maj-eyal.lua"
,
"/data/general/objects/objects-far-east.lua"
}
do
require
(
"mod.class.Object"
):
loadList
(
file
,
nil
,
list
,
nil
,
loaded
)
end
local
images
=
{}
for
i
,
e
in
ipairs
(
list
)
do
if
e
.
unique
and
not
e
.
randart
and
not
e
.
lore
and
type
(
e
.
image
)
==
"string"
then
print
(
"===== "
,
e
.
name
,
"::"
,
e
.
image
)
images
[
e
.
image
]
=
images
[
e
.
image
]
or
{}
table.insert
(
images
[
e
.
image
],
e
.
name
)
end
end
local
filter
=
{}
for
i
,
n
in
pairs
(
images
)
do
if
#
n
>
1
then
filter
[
i
]
=
n
end
end
table
.
print
(
filter
)
do
return
end
self
:
changeLevel
(
game
.
level
.
level
+
1
)
do
return
end
...
...
This diff is collapsed.
Click to expand it.
game/modules/tome/class/GameState.lua
+
21
−
6
View file @
ae783a7e
...
...
@@ -25,6 +25,7 @@ local Map = require "engine.Map"
local
NameGenerator
=
require
"engine.NameGenerator"
local
NameGenerator2
=
require
"engine.NameGenerator2"
local
Donation
=
require
"mod.dialogs.Donation"
local
Dialog
=
require
"engine.ui.Dialog"
module
(
...
,
package
.
seeall
,
class
.
inherit
(
engine
.
Entity
))
...
...
@@ -2474,10 +2475,11 @@ function _M:infiniteDungeonChallenge(zone, lev, data, id_layout_name, id_grids_n
self
.
id_challenge
.
count
=
self
.
id_challenge
.
count
+
1
local
challenges
=
{
{
id
=
"pacifist"
,
rarity
=
3
},
{
id
=
"exterminator"
,
rarity
=
1
},
{
id
=
"dream-horror"
,
rarity
=
10
,
min_lev
=
15
},
{
id
=
"fast-exit"
,
rarity
=
3
,
min_lev
=
8
},
-- { id = "pacifist", rarity = 3 },
-- { id = "exterminator", rarity = 1 },
-- { id = "dream-horror", rarity = 10, min_lev = 15 },
-- { id = "fast-exit", rarity = 3, min_lev = 8 },
{
id
=
"near-sighted"
,
rarity
=
3
,
min_lev
=
4
},
}
self
:
triggerHook
{
"InfiniteDungeon:getChallenges"
,
challenges
=
challenges
}
...
...
@@ -2493,7 +2495,7 @@ function _M:infiniteDungeonChallenge(zone, lev, data, id_layout_name, id_grids_n
print
(
"[INFINITE DUNGEON] Selected challenge"
,
data
.
id_challenge
)
end
function
_M
:
makeChallengeQuest
(
level
,
name
,
desc
,
data
)
function
_M
:
makeChallengeQuest
(
level
,
name
,
desc
,
data
,
alter_effect
)
local
q
=
{
id
=
"id-challenge-"
..
level
.
level
,
name
=
"Infinite Dungeon Challenge: "
..
name
..
" (Level "
..
level
.
level
..
")"
,
...
...
@@ -2528,7 +2530,11 @@ function _M:makeChallengeQuest(level, name, desc, data)
table
.
merge
(
q
,
data
)
local
p
=
game
:
getPlayer
(
true
)
p
:
grantQuest
(
q
)
game
:
onTickEnd
(
function
()
p
:
setEffect
(
p
.
EFF_ZONE_AURA_CHALLENGE
,
1
,
{
id_challenge_quest
=
q
.
id
})
end
)
game
:
onTickEnd
(
function
()
p
:
setEffect
(
p
.
EFF_ZONE_AURA_CHALLENGE
,
1
,
{
id_challenge_quest
=
q
.
id
})
local
eff
=
p
:
hasEffect
(
p
.
EFF_ZONE_AURA_CHALLENGE
)
if
eff
and
alter_effect
then
alter_effect
(
p
,
eff
)
end
end
)
return
q
end
...
...
@@ -2614,6 +2620,15 @@ function _M:infiniteDungeonChallengeFinish(zone, level)
zone
:
addEntity
(
level
,
m
,
"actor"
,
x
,
y
)
end
end
elseif
id_challenge
==
"near-sighted"
then
Dialog
:
yesnoPopup
(
"Challenge: #PURPLE#Near Sighted"
,
"Finish the level with -7 sight range for a reward."
,
function
(
r
)
if
not
r
then
self
:
makeChallengeQuest
(
level
,
"Near Sighted"
,
"Finish the level with -7 sight range."
,
{
on_exit_check
=
function
(
self
,
who
)
who
:
setQuestStatus
(
self
.
id
,
self
.
COMPLETED
)
end
,
},
function
(
actor
,
eff
)
actor
:
effectTemporaryValue
(
eff
,
"sight"
,
-
7
)
end
)
end
end
,
"Refuse"
,
"Accept"
,
true
)
else
self
:
triggerHook
{
"InfiniteDungeon:setupChallenge"
,
id_challenge
=
id_challenge
,
zone
=
zone
,
level
=
level
}
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment