From 01b038ff27a51d450043af42bc29a5850758b002 Mon Sep 17 00:00:00 2001 From: Uristqwerty Date: Thu, 24 May 2012 01:34:35 -0400 Subject: [PATCH] Introducing Uristrunes! Built crom components, each cult word gets it's own unique appearance, that it adds to the final rune. Correct combinations will glow ever so slightly, the others remain a single colour. The system behind them is a bit more powerful, supporting a full 1023 combinations, although far fewer can be reached in-game (as the system doesn't care about word order, and you can't use enough words to have more than three of the components as part of any rune). With this commit, it compiles, but I haven't quite tested anything in-game, so there might be a followup bugfix. Or there may not. --- baystation12.dme | 1 + code/game/magic/Uristrunes.dm | 131 ++++++++++++++++++++++++++++++ code/game/magic/cultist/ritual.dm | 8 ++ icons/effects/uristrunes.dmi | Bin 0 -> 1233 bytes 4 files changed, 140 insertions(+) create mode 100644 code/game/magic/Uristrunes.dm create mode 100644 icons/effects/uristrunes.dmi diff --git a/baystation12.dme b/baystation12.dme index 8e69350ebe..914ee0e05e 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -592,6 +592,7 @@ #include "code\game\magic\archived_book.dm" #include "code\game\magic\library.dm" #include "code\game\magic\musician.dm" +#include "code\game\magic\Uristrunes.dm" #include "code\game\magic\cultist\ritual.dm" #include "code\game\magic\cultist\runes.dm" #include "code\game\magic\cultist\talisman.dm" diff --git a/code/game/magic/Uristrunes.dm b/code/game/magic/Uristrunes.dm new file mode 100644 index 0000000000..a25a80a78e --- /dev/null +++ b/code/game/magic/Uristrunes.dm @@ -0,0 +1,131 @@ + +var/list/word_to_uristrune_table = null + +/proc/word_to_uristrune_bit(word) + if(word_to_uristrune_table == null) + word_to_uristrune_table = list() + + var/bit = 1 + var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "mgar", "balaq", "karazet", "geeri") + + while(length(words)) + var/w = pick(words) + + word_to_uristrune_table[w] = bit + + words -= w + bit <<= 1 + + return word_to_uristrune_table[word] + + + +/proc/get_uristrune_cult(word1, word2, word3) + var/animated + + if((word1 == wordtravel && word2 == wordself) \ + || (word1 == wordjoin && word2 == wordblood && word3 == wordself) \ + || (word1 == wordhell && word2 == wordjoin && word3 == wordself) \ + || (word1 == wordsee && word2 == wordblood && word3 == wordhell) \ + || (word1 == worddestr && word2 == wordsee && word3 == wordtech) \ + || (word1 == wordtravel && word2 == wordblood && word3 == wordself) \ + || (word1 == wordsee && word2 == wordhell && word3 == wordjoin) \ + || (word1 == wordblood && word2 == wordjoin && word3 == wordhell) \ + || (word1 == wordhide && word2 == wordsee && word3 == wordblood) \ + || (word1 == wordhell && word2 == wordtravel && word3 == wordself) \ + || (word1 == wordblood && word2 == wordsee && word3 == wordtravel) \ + || (word1 == wordhell && word2 == wordtech && word3 == wordjoin) \ + || (word1 == wordhell && word2 == wordblood && word3 == wordjoin) \ + || (word1 == wordblood && word2 == wordsee && word3 == wordhide) \ + || (word1 == worddestr && word2 == wordtravel && word3 == wordself) \ + || (word1 == wordtravel && word2 == wordtech && word3 == wordother) \ + || (word1 == wordjoin && word2 == wordother && word3 == wordself) \ + || (word1 == wordhide && word2 == wordother && word3 == wordsee) \ + || (word1 == worddestr && word2 == wordsee && word3 == wordother) \ + || (word1 == worddestr && word2 == wordsee && word3 == wordblood) \ + || (word1 == wordself && word2 == wordother && word3 == wordtech) \ + || (word1 == wordtravel && word2 == wordother) \ + || (word1 == wordjoin && word2 == wordhide && word3 == wordtech) ) + animated = 1 + else + animated = 0 + + var/bits = word_to_uristrune_bit(word1) \ + | word_to_uristrune_bit(word2) \ + | word_to_uristrune_bit(word3) + + return get_uristrune(bits, animated) + + +var/list/uristrune_cache = list() + +/proc/get_uristrune(symbol_bits, animated = 0) + var/lookup = "[symbol_bits]-[animated]" + + if(lookup in uristrune_cache) + return uristrune_cache[lookup] + + var/icon/I = icon('icons/effects/uristrunes.dmi', "blank") + + for(var/i = 0, i < 10, i++) + if(symbol_bits & (1 << i)) + I.Blend(icon('icons/effects/uristrunes.dmi', "rune-[i]"), ICON_OVERLAY) + + + I.SwapColor(rgb(0, 0, 0, 100), rgb(100, 0, 0, 200)) + I.SwapColor(rgb(0, 0, 0, 50), rgb(150, 0, 0, 200)) + + for(var/x = 1, x <= 32, x++) + for(var/y = 1, y <= 32, y++) + var/p = I.GetPixel(x, y) + + if(p == null) + var/n = I.GetPixel(x, y + 1) + var/s = I.GetPixel(x, y - 1) + var/e = I.GetPixel(x + 1, y) + var/w = I.GetPixel(x - 1, y) + + if(n == "#000000" || s == "#000000" || e == "#000000" || w == "#000000") + I.DrawBox(rgb(200, 0, 0, 200), x, y) + + else + var/ne = I.GetPixel(x + 1, y + 1) + var/se = I.GetPixel(x + 1, y - 1) + var/nw = I.GetPixel(x - 1, y + 1) + var/sw = I.GetPixel(x - 1, y - 1) + + if(ne == "#000000" || se == "#000000" || nw == "#000000" || sw == "#000000") + I.DrawBox(rgb(200, 0, 0, 100), x, y) + + var/icon/result = icon(I, "") + + result.Insert(I, "", frame = 1, delay = 10) + + if(animated == 1) + var/icon/I2 = icon(I, "") + I2.MapColors(rgb(0xff,0x0c,0,0), rgb(0,0,0,0), rgb(0,0,0,0), rgb(0,0,0,0xff)) + I2.SetIntensity(1.04) + + var/icon/I3 = icon(I, "") + I3.MapColors(rgb(0xff,0x18,0,0), rgb(0,0,0,0), rgb(0,0,0,0), rgb(0,0,0,0xff)) + I3.SetIntensity(1.08) + + var/icon/I4 = icon(I, "") + I4.MapColors(rgb(0xff,0x24,0,0), rgb(0,0,0,0), rgb(0,0,0,0), rgb(0,0,0,0xff)) + I4.SetIntensity(1.12) + + var/icon/I5 = icon(I, "") + I5.MapColors(rgb(0xff,0x30,0,0), rgb(0,0,0,0), rgb(0,0,0,0), rgb(0,0,0,0xff)) + I5.SetIntensity(1.16) + + result.Insert(I2, "", frame = 2, delay = 4) + result.Insert(I3, "", frame = 3, delay = 3) + result.Insert(I4, "", frame = 4, delay = 2) + result.Insert(I5, "", frame = 5, delay = 6) + result.Insert(I4, "", frame = 6, delay = 2) + result.Insert(I3, "", frame = 7, delay = 2) + result.Insert(I2, "", frame = 8, delay = 2) + + uristrune_cache[lookup] = result + + return result diff --git a/code/game/magic/cultist/ritual.dm b/code/game/magic/cultist/ritual.dm index 5b4cb7f5c8..6c1304a225 100644 --- a/code/game/magic/cultist/ritual.dm +++ b/code/game/magic/cultist/ritual.dm @@ -1,4 +1,8 @@ + +var/use_uristrunes = 1 + + var/wordtravel = null var/wordself = null var/wordsee = null @@ -207,6 +211,10 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", return check_icon() + if(use_uristrunes) + icon = get_uristrune_cult(word1, word2, word3) + return + if(word1 == wordtravel && word2 == wordself) icon_state = "2" src.icon += rgb(0, 0 , 255) diff --git a/icons/effects/uristrunes.dmi b/icons/effects/uristrunes.dmi new file mode 100644 index 0000000000000000000000000000000000000000..04519afc7e099e3d229c56318db5ac80dcb3829e GIT binary patch literal 1233 zcmV;?1TOoDP)V=-0C=2@&ba(G5)wEF{zPngRBjYg4Je7G%TJGr>xp;2A#F0K`cIiw5?N#dH^ z!*BanrC0Pj$;%WkYkAp`Y3q4i!_@Umo>WYr>X^b#{w3BJCId5C`U2_thZ+yhg=GK$ z1M*2kK~#90?VZt)>mUq8mCUPXD^M|URZcNfur1~Nm_&AP)-eJkxaVufnOWm-EhHh7 zO9+9$xLjKg0JH@H7#s*-a3BE3F!L?+MMQ|U@?8ooWh(v=1fYa`8*BJ3%RRFF00`g%UnX6iPG5v0vH?!pfi~H_RS_11kfqVVUo8r@%9=7;Fz6# z0J$waC#=D0Lkj}%&ED>0+_s*GK9`O`0KWNnQb^P$>=vd%0FK!yPFYYs?^h;6zvZSfsVZgl4r?Xb-V`Wkru#h$7^t& zE77Z1AzFcL`Ld-NHlWMX0?7JxqL&Dcv`Ghk+1(4sIdKY((>f1;&7j7#764Mgg%JLf zY5xhS;FB=(Efp=vrIVS>M^q5Nd1fNo`vEC8SyTuh18D_B2Gy0r3<2aZFHW4x-wY&z z6L=cgeob6+VfG~uKpxZ1-)?{aGT1a^bocfXK>*prrNC>aGYCKd(csEW_!mJGpoF)H zj|^o2EOzN?%@7tq7PvMYh(Wp)0FIm=qe}sxmf<+42WSlH0V?1zKCeZWO8`;Q2bewV v&)23)0ie;;ak>%!CjNWi1U3dvAZW^eki_DDF+EFy00000NkvXXu0mjfPXHI4 literal 0 HcmV?d00001