-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Factions, quests, touch ups, ux, and other features/improvements full…
…y integrated
- Loading branch information
1 parent
22d92b8
commit 55c4ae3
Showing
66 changed files
with
2,539 additions
and
725 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package quests | ||
|
||
import "github.com/keep-starknet-strange/art-peace/backend/core" | ||
|
||
var QuestClaimData = map[int]func(*Quest, string) []int { | ||
NFTMintQuestType: NFTMintQuestClaimData, | ||
} | ||
|
||
func (q *Quest) GetQuestClaimData(user string) []int { | ||
if f, ok := QuestClaimData[q.Type]; ok { | ||
return f(q, user) | ||
} | ||
return nil | ||
} | ||
|
||
func NFTMintQuestClaimData(q *Quest, user string) []int { | ||
nftQuestInputs := NewNFTQuestInputs(q.InputData) | ||
if nftQuestInputs.IsDaily { | ||
tokenId, err := core.PostgresQueryOne[int]("SELECT token_id FROM NFTs WHERE minter = $1 AND day_index = $2", user, nftQuestInputs.ClaimDay) | ||
if err != nil { | ||
return nil | ||
} | ||
return []int{*tokenId} | ||
} else { | ||
tokenId, err := core.PostgresQueryOne[int]("SELECT token_id FROM NFTs WHERE minter = $1", user) | ||
if err != nil { | ||
return nil | ||
} | ||
return []int{*tokenId} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.