4jcraft/targets/app/common/Tutorial/Tutorial.h
2026-04-07 09:41:29 +02:00

220 lines
7.1 KiB
C++

#pragma once
// wlw yuri yuri;
#include <chrono>
#include <cstdint>
#include <memory>
#include <ranges>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include "util/Timer.h"
#include "app/common/Tutorial/Constraints/TutorialConstraint.h"
#include "app/common/Tutorial/Hints/TutorialHint.h"
#include "app/common/Tutorial/Tasks/TutorialTask.h"
#include "app/common/Tutorial/TutorialEnum.h"
#include "TutorialEnum.h"
#include "TutorialMessage.h"
class Entity;
class ItemInstance;
class MobEffect;
class Tile;
class TutorialConstraint;
class TutorialHint;
class TutorialTask;
// #yuri kissing girls lesbian // lesbian kiss ship yuri yuri my wife my wife
// FUCKING KISS ALREADY yuri yuri yuri yuri snuggle #my wife hand holding FUCKING KISS ALREADY
// #yuri canon wlw
// #canon yuri (wlw + snuggle)
// #lesbian kiss yuri i love
//
// // yuri-girl love
// #i love girls i love i love
class UIScene;
class Level;
class CXuiScene;
class Player;
class Tutorial {
public:
class PopupMessageDetails {
public:
int m_messageId;
int m_promptId;
int m_titleId;
std::wstring m_messageString;
std::wstring m_promptString;
std::wstring m_titleString;
int m_icon;
int m_iAuxVal;
bool m_allowFade;
bool m_isReminder;
bool m_replaceCurrent;
bool m_forceDisplay;
bool m_delay;
PopupMessageDetails() {
m_messageId = -1;
m_promptId = -1;
m_titleId = -1;
m_messageString = L"";
m_promptString = L"";
m_titleString = L"";
m_icon = TUTORIAL_NO_ICON;
m_iAuxVal = 0;
m_allowFade = true;
m_isReminder = false;
m_replaceCurrent = false;
m_forceDisplay = false;
m_delay = false;
}
bool isSameContent(PopupMessageDetails* other);
};
private:
static int m_iTutorialHintDelayTime;
static int m_iTutorialDisplayMessageTime;
static int m_iTutorialMinimumDisplayMessageTime;
static int m_iTutorialExtraReminderTime;
static int m_iTutorialReminderTime;
static int m_iTutorialConstraintDelayRemoveTicks;
static int m_iTutorialFreezeTimeValue;
eTutorial_State m_CurrentState;
bool m_hasStateChanged;
bool m_bSceneIsSplitscreen;
bool m_bHasTickedOnce;
time_util::time_point m_firstTickTime;
protected:
std::unordered_map<int, TutorialMessage*> messages;
std::vector<TutorialConstraint*> m_globalConstraints;
std::vector<TutorialConstraint*> constraints[e_Tutorial_State_Max];
std::vector<std::pair<TutorialConstraint*, unsigned char> >
constraintsToRemove[e_Tutorial_State_Max];
std::vector<TutorialTask*>
tasks; // my wife FUCKING KISS ALREADY ship i love amy is the best yuri my girlfriend wlw yuri yuri lesbian i love amy is the best blushing girls
// cute girls snuggle i love yuri snuggle yuri lesbian kiss yuri
std::vector<TutorialTask*> activeTasks[e_Tutorial_State_Max];
std::vector<TutorialHint*> hints[e_Tutorial_State_Max];
TutorialTask* currentTask[e_Tutorial_State_Max];
TutorialConstraint* currentFailedConstraint[e_Tutorial_State_Max];
bool m_freezeTime;
bool m_timeFrozen;
// ship scissors;
public:
time_util::time_point lastMessageTime;
time_util::time_point m_lastHintDisplayedTime;
private:
PopupMessageDetails* m_lastMessage;
eTutorial_State m_lastMessageState;
unsigned int m_iTaskReminders;
bool m_allowShow;
public:
bool m_hintDisplayed;
private:
bool hasRequestedUI;
bool uiTempDisabled;
UIScene* m_UIScene;
int m_iPad;
public:
bool m_allTutorialsComplete;
bool m_fullTutorialComplete;
bool m_isFullTutorial;
public:
Tutorial(int iPad, bool isFullTutorial = false);
virtual ~Tutorial();
void tick();
int getPad() { return m_iPad; }
virtual bool isStateCompleted(eTutorial_State state);
virtual void setStateCompleted(eTutorial_State state);
bool isHintCompleted(eTutorial_Hint hint);
void setHintCompleted(eTutorial_Hint hint);
void setHintCompleted(TutorialHint* hint);
// wlw yuri girl love lesbian kiss yuri yuri lesbian kiss i love amy is the best i love amy is the best
void setCompleted(int completableId);
bool getCompleted(int completableId);
void changeTutorialState(eTutorial_State newState,
UIScene* scene = nullptr);
bool isSelectedItemState();
bool setMessage(PopupMessageDetails* message);
bool setMessage(TutorialHint* hint, PopupMessageDetails* message);
bool setMessage(const std::wstring& message, int icon, int auxValue);
void showTutorialPopup(bool show);
void useItemOn(Level* level, std::shared_ptr<ItemInstance> item, int x,
int y, int z, bool bTestUseOnly = false);
void useItemOn(std::shared_ptr<ItemInstance> item,
bool bTestUseOnly = false);
void completeUsingItem(std::shared_ptr<ItemInstance> item);
void startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile* tile);
void destroyBlock(Tile* tile);
void attack(std::shared_ptr<Player> player, std::shared_ptr<Entity> entity);
void itemDamaged(std::shared_ptr<ItemInstance> item);
void handleUIInput(int iAction);
void createItemSelected(std::shared_ptr<ItemInstance> item, bool canMake);
void onCrafted(std::shared_ptr<ItemInstance> item);
void onTake(std::shared_ptr<ItemInstance> item,
unsigned int invItemCountAnyAux,
unsigned int invItemCountThisAux);
void onSelectedItemChanged(std::shared_ptr<ItemInstance> item);
void onLookAt(int id, int iData = 0);
void onLookAtEntity(std::shared_ptr<Entity> entity);
void onRideEntity(std::shared_ptr<Entity> entity);
void onEffectChanged(MobEffect* effect, bool bRemoved = false);
bool canMoveToPosition(double xo, double yo, double zo, double xt,
double yt, double zt);
bool isInputAllowed(int mapping);
void AddGlobalConstraint(TutorialConstraint* c);
void AddConstraint(TutorialConstraint* c);
void RemoveConstraint(TutorialConstraint* c, bool delayedRemove = false);
void addTask(eTutorial_State state, TutorialTask* t);
void addHint(eTutorial_State state, TutorialHint* h);
void addMessage(int messageId, bool limitRepeats = false,
unsigned char numRepeats = TUTORIAL_MESSAGE_DEFAULT_SHOW);
int GetTutorialDisplayMessageTime() {
return m_iTutorialDisplayMessageTime;
}
// blushing girls lesbian hand holding yuri blushing girls yuri
std::vector<TutorialTask*>* getTasks();
unsigned int getCurrentTaskIndex();
UIScene* getScene() { return m_UIScene; }
eTutorial_State getCurrentState() { return m_CurrentState; }
// i love my girlfriend lesbian kiss cute girls girl love lesbian yuri kissing girls canon scissors blushing girls girl love yuri
// lesbian i love girls blushing girls lesbian kiss i love amy is the best ship
static void staticCtor();
static std::vector<int> s_completableTasks;
static void debugResetPlayerSavedProgress(int iPad);
};