Skip to content

Commit

Permalink
upload dir
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis committed Jan 30, 2024
1 parent 1da4fa8 commit c7445e6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/paragraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ Paragraph tags are never considered to be a DOM. Only certain tags have range an
<p>&lt;if STAT eq|gt|lt|ne dice&gt; ... [&lt;else&gt;] ... &lt;endif&gt;</p>
<p>&lt;if race orc&gt;, &lt;if race human&gt;....</p>
<p>&lt;if prof wizard&gt;, &lt;if prof warrior&gt;</p>
<p>&lt;if premium&gt;</p>
</td>
<td>
Display next part of the paragraph if STAT is equal (eq), greater than (gt), less than (lt) or not equal (ne) to the value you provide. Valid values for STAT are: stm - stamina; skl - skill; wpn - weapon; arm - armour; exp - experience; luck - luck; spd - speed
Display next part of the paragraph if STAT is equal (eq), greater than (gt), less than (lt) or not equal (ne) to the value you provide. Valid values for STAT are: stm - stamina; skl - skill; wpn - weapon; arm - armour; exp - experience; luck - luck; spd - speed; scrolls - scrolls; level - level
<p>When checking with the &lt;if flag&gt; tag, you may check against a local flag (set with &lt;set&gt;) or a global flag (set with &lt;setglobal&gt;).</p>
<p>With the &lt;if dice&gt; tag, you must have used the &lt;dice&gt; tag previously to have a result to check against. N must be in the range 1-6.</p>
<p>When using the &lt;if prof&gt; or &lt;if race&gt; tags, these compare against the current players race or profession, only use the ones valid in the game, in lower case only.</p>
Expand Down
2 changes: 2 additions & 0 deletions src/listeners.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <ssod/commands/profile.h>
#include <ssod/commands/gender.h>
#include <ssod/commands/vote.h>
#include <ssod/commands/bio.h>

#include <ssod/botlist.h>
#include <ssod/botlists/topgg.h>
Expand Down Expand Up @@ -166,6 +167,7 @@ namespace listeners {
register_command<profile_command>(bot),
register_command<gender_command>(bot),
register_command<vote_command>(bot),
register_command<bio_command>(bot),
});
bot.guild_bulk_command_create({
register_command<admin_command>(bot),
Expand Down
9 changes: 9 additions & 0 deletions src/parser/if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
************************************************************************************/
#include <ssod/ssod.h>
#include <ssod/parser.h>
#include <ssod/database.h>

bool comparison(std::string condition, long C1, const std::string& C2, int g_dice) {
long C = C2 == "dice" ? g_dice : atol(C2);
Expand Down Expand Up @@ -80,6 +81,7 @@ struct if_tag : public tag {
{ "spd", current_player.speed },
{ "luck", current_player.luck },
{ "scrolls", current_player.scrolls },
{ "level", current_player.get_level() },
};
auto check = scorename_map.find(scorename);
if (check != scorename_map.end()) {
Expand Down Expand Up @@ -118,6 +120,13 @@ struct if_tag : public tag {
||
(dpp::lowercase(p_text) == "woodsman>" && current_player.profession == prof_woodsman);
return;
} else if (dpp::lowercase(p_text) == "premium>") {
// ------------------------------------------------------
// <if premium>
// ------------------------------------------------------
auto rs = db::query("SELECT * FROM premium_credits WHERE user_id = ? AND active = 1", { current_player.event.command.usr.id });
p.display = rs.size();
return;
}
}
};
Expand Down
Empty file added uploads/.gitkeep
Empty file.

0 comments on commit c7445e6

Please sign in to comment.