diff --git a/_maps/map_files/coyote_bayou/foxybarupper.dmm b/_maps/map_files/coyote_bayou/foxybarupper.dmm index 31bebb0857..758b5d23c5 100644 --- a/_maps/map_files/coyote_bayou/foxybarupper.dmm +++ b/_maps/map_files/coyote_bayou/foxybarupper.dmm @@ -3313,9 +3313,6 @@ /turf/open/floor/wood_common/wood_common_dark, /area/f13/fb/bar) "HK" = ( -/obj/machinery/computer/arcade{ - density = 0 - }, /obj/effect/turf_decal/siding/wood{ dir = 1; color = "#3B2B1A" @@ -3332,6 +3329,7 @@ dir = 1; color = "#3B2B1A" }, +/obj/machinery/computer/arcade/battle, /turf/open/floor/carpet/arcade, /area/f13/fb/bar) "Ib" = ( @@ -3440,9 +3438,7 @@ dir = 4; color = "#3B2B1A" }, -/obj/machinery/computer/arcade{ - density = 0 - }, +/obj/machinery/computer/arcade/orion_trail, /turf/open/floor/carpet/arcade, /area/f13/fb/bar) "JG" = ( @@ -4298,10 +4294,8 @@ dir = 1; color = "#3B2B1A" }, -/obj/machinery/computer/arcade{ - density = 0 - }, /obj/effect/sound_emitter/foxybar/machinery, +/obj/machinery/computer/arcade/tetris, /turf/open/floor/carpet/arcade, /area/f13/fb/bar) "Ts" = ( diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 8d4bf4abda..4a9035cfbc 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -29,6 +29,8 @@ if(!circuit) var/list/gameodds = list(/obj/item/circuitboard/computer/arcade/battle = 33, /obj/item/circuitboard/computer/arcade/orion_trail = 33, + /obj/item/circuitboard/computer/arcade/tetris = 33 + ) var/thegame = pickweight(gameodds) var/obj/item/circuitboard/CB = new thegame() diff --git a/fortune13.dme b/fortune13.dme index 57b914e807..d19349fb9f 100644 --- a/fortune13.dme +++ b/fortune13.dme @@ -3985,6 +3985,7 @@ #include "modular_sand\code\_onclick\hud\hud.dm" #include "modular_sand\code\_onclick\hud\screen_objects.dm" #include "modular_sand\code\controllers\configuration\entries\sandstorm.dm" +#include "modular_sand\code\controllers\configuration\entries\sandstorm_balance.dm" #include "modular_sand\code\controllers\subsystem\interactions.dm" #include "modular_sand\code\datums\components\autoplapper.dm" #include "modular_sand\code\datums\components\glory_kill.dm" @@ -4017,16 +4018,19 @@ #include "modular_sand\code\game\area\ship_area.dm" #include "modular_sand\code\game\area\areas\shuttles.dm" #include "modular_sand\code\game\area\areas\ruins\lavaland.dm" +#include "modular_sand\code\game\machinery\computer\arcade\tetris.dm" #include "modular_sand\code\game\objects\effects\decals\cleanable\lewd_decals.dm" #include "modular_sand\code\game\objects\items\cigs_lighters.dm" #include "modular_sand\code\game\objects\items\cosmetics.dm" #include "modular_sand\code\game\objects\items\fleshlight.dm" #include "modular_sand\code\game\objects\items\plushes.dm" +#include "modular_sand\code\game\objects\items\circuitboards\computer_circuitboards.dm" #include "modular_sand\code\game\objects\items\plushes\plushes.dm" #include "modular_sand\code\game\objects\items\plushes\saliith.dm" #include "modular_sand\code\modules\arousal\arousal.dm" #include "modular_sand\code\modules\arousal\genital_sprite_accessories.dm" #include "modular_sand\code\modules\arousal\genitals.dm" +#include "modular_sand\code\modules\client\asset_cache.dm" #include "modular_sand\code\modules\mob\mob.dm" #include "modular_splurt\character_directory.dm" #include "modular_splurt\code\datums\mind.dm" diff --git a/modular_sand/code/game/machinery/computer/arcade/tetris.dm b/modular_sand/code/game/machinery/computer/arcade/tetris.dm index 0ddd5be709..19b7edde7d 100644 --- a/modular_sand/code/game/machinery/computer/arcade/tetris.dm +++ b/modular_sand/code/game/machinery/computer/arcade/tetris.dm @@ -1,11 +1,12 @@ // Configuration defines -#define TETRIS_REWARD_DIVISOR CONFIG_GET(number/tetris_reward_divisor) -#define TETRIS_PRIZES_MAX CONFIG_GET(number/tetris_prizes_max) -#define TETRIS_SCORE_HIGH CONFIG_GET(number/tetris_score_high) -#define TETRIS_SCORE_MAX CONFIG_GET(number/tetris_score_max) -#define TETRIS_SCORE_MAX_SCI CONFIG_GET(number/tetris_score_max_sci) -#define TETRIS_TIME_COOLDOWN CONFIG_GET(number/tetris_time_cooldown) -#define TETRIS_NO_SCIENCE CONFIG_GET(flag/tetris_no_science) +//Let's hardcode this because I can't get CONFIG_GET working for the life of me +#define TETRIS_REWARD_DIVISOR 1000 +#define TETRIS_PRIZES_MAX 10 +#define TETRIS_SCORE_HIGH 10000 +#define TETRIS_SCORE_MAX 100000 +#define TETRIS_SCORE_MAX_SCI 10000 +#define TETRIS_TIME_COOLDOWN 600 +#define TETRIS_NO_SCIENCE TRUE // Cooldown defines #define TETRIS_COOLDOWN_MAIN cooldown_timer @@ -58,7 +59,8 @@ COOLDOWN_START(src, TETRIS_COOLDOWN_MAIN, TETRIS_TIME_COOLDOWN) // Vend prizes - prizevend(usr, reward_count) + for(var/i = 0; i < reward_count; i++) + prizevend(usr) // Check if science points are possible and allowed if((!SSresearch.science_tech) || TETRIS_NO_SCIENCE) diff --git a/modular_sand/code/game/objects/items/circuitboards/computer_circuitboards.dm b/modular_sand/code/game/objects/items/circuitboards/computer_circuitboards.dm index 5dc568dca9..0e1d54ed65 100644 --- a/modular_sand/code/game/objects/items/circuitboards/computer_circuitboards.dm +++ b/modular_sand/code/game/objects/items/circuitboards/computer_circuitboards.dm @@ -1,7 +1,7 @@ -/obj/item/circuitboard/computer/telesci_console +/*/obj/item/circuitboard/computer/telesci_console name = "Telescience Control Console (Computer Board)" build_path = /obj/machinery/computer/telescience - +*/ /obj/item/circuitboard/computer/arcade/tetris name = "Tetris (Computer Board)" build_path = /obj/machinery/computer/arcade/tetris diff --git a/tgui/src/interfaces/tetris/tetris.js b/tgui/src/interfaces/tetris/tetris.js new file mode 100644 index 0000000000..0abb6a8614 --- /dev/null +++ b/tgui/src/interfaces/tetris/tetris.js @@ -0,0 +1,321 @@ +var i, j, IsOver, MaxX=10, MaxY=20, NextCol, Col, Score, Lines, IsHideFocus=true; +PosX=new Array(4); +PosY=new Array(4); +Delay=new Array(828,620,464,348,260,196,148,112,84,64,48,36,27); +Fld = new Array(MaxX); +for (i=0; i < MaxX; i++) +{ Fld[i]=new Array(MaxY); +} +RFld=new Array(MaxY); +Pic= new Array(8); +for (i=0; i<8; i++) +{ Pic[i] = new Image(); + Pic[i].src = "tetris_"+i+".gif"; +} +PrePic= new Array(8); +for (i=0; i<8; i++) +{ PrePic[i] = new Image(); + PrePic[i].src = "tetrisp"+i+".gif"; +} +PatternX=new Array(7); +PatternY=new Array(7); +PatternX[0]=new Array(0,1,2,3); +PatternY[0]=new Array(0,0,0,0); +PatternX[1]=new Array(2,1,0,0); +PatternY[1]=new Array(0,0,0,1); +PatternX[2]=new Array(2,1,1,0); +PatternY[2]=new Array(1,1,0,0); +PatternX[3]=new Array(1,2,1,2); +PatternY[3]=new Array(0,0,1,1); +PatternX[4]=new Array(1,2,2,3); +PatternY[4]=new Array(1,1,0,0); +PatternX[5]=new Array(1,2,3,3); +PatternY[5]=new Array(0,0,0,1); +PatternX[6]=new Array(1,2,3,2); +PatternY[6]=new Array(0,0,0,1); +function KeyDown(whichkey) +{ //alert(whichkey); + if (IsOver) return; + if (PosY<0) return; + if (whichkey == 37) Left(); + if (whichkey == 38) Rotate(); + if (whichkey == 39) Right(); + if (whichkey == 40) Down(); + + if (whichkey == 50) Down(); + if (whichkey == 52) Left(); + if (whichkey == 53) Down(); + if (whichkey == 54) Right(); + if (whichkey == 56) Rotate(); + + if (whichkey == 65458) Down(); + if (whichkey == 65460) Left(); + if (whichkey == 65461) Down(); + if (whichkey == 65462) Right(); + if (whichkey == 65464) Rotate(); +} +function Pause() +{ IsOver=true; + alert("Click OK to continue!"); + setTimeout("Init(false)",540); +} +function New() +{ IsOver=true; + setTimeout("Init(true)",540); +} +function Init(nn) +{ IsOver=false; + if (nn) + { for (i=0; i0) IsOver=true; + } + if (IsOver) + { if (CanShift(0,-1)) + { for (nn=0; nn<4; nn++) + document.images[PosX[nn]+MaxX*(PosY[nn]-1)].src = Pic[Col+1].src; + } + //if (confirm("Super, you got a score of "+Score+" ! Play again ?")) Init(true); + submitScore(Score); + return; + } + for (nn=0; nn<4; nn++) + { Fld[PosX[nn]][PosY[nn]]=Col+1; + document.images[PosX[nn]+MaxX*PosY[nn]].src = Pic[Col+1].src; + } + } + else + { for (nn=0; nn<4; nn++) + Fld[PosX[nn]][PosY[nn]]=0; + if (CanShift(0,1)) + { for (nn=0; nn<4; nn++) + Fld[PosX[nn]][PosY[nn]]=Col+1; + Shift(0,1); + } + else + { for (nn=0; nn<4; nn++) + Fld[PosX[nn]][PosY[nn]]=Col+1; + PosY[0]=-1; + Remove(); + window.document.ScoreForm.Score.value = Score; + window.document.ScoreForm.Level.value = Level; + window.document.ScoreForm.Lines.value = Lines; + } + } + //setTimeout("Go()",50*(11-Level)); + setTimeout("Go()",Delay[Level]); +} +function CanShift(xx, yy) +{ var nn, cc=true; + for (nn=0; nn<4; nn++) + { if (PosX[nn]+xx<0) return(false); + if (PosX[nn]+xx>=MaxX) return(false); + if (PosY[nn]+yy>=MaxY) return(false); + if (Fld[PosX[nn]+xx][PosY[nn]+yy]>0) return(false); + } + return(true); +} +function GetFld(xx, yy) +{ if (xx<0) return(-1); + if (xx>=MaxX) return(-1); + if (yy<0) return(-1); + if (yy>=MaxY) return(-1); + return(Fld[xx][yy]); +} +function Rotate() +{ if (IsOver) return; + if (PosY[0]<0) return; + var nn, ii, jj; + for (nn=0; nn<4; nn++) + Fld[PosX[nn]][PosY[nn]]=0; + if (!CanRotate()) + { for (nn=0; nn<4; nn++) + Fld[PosX[nn]][PosY[nn]]=Col+1; + return; + } + for (nn=0; nn<4; nn++) + document.images[PosX[nn]+MaxX*PosY[nn]].src = Pic[0].src; + if (Col==0) + { if (PosY[0]==PosY[1]) + { PosX[0]+=2;PosY[0]-=1; + PosX[1]+=1;PosY[2]+=1; + PosX[3]-=1;PosY[3]+=2; + } + else + { PosX[0]-=2;PosY[0]+=2; + PosX[1]-=1;PosY[1]+=1; + PosX[3]+=1;PosY[3]-=1; + } + } + if ((Col==2)||(Col==4)) + { if (PosY[0]==PosY[1]) + { PosX[0]-=1*(3-Col);PosY[0]-=1; + PosX[2]-=1*(3-Col);PosY[2]+=1; + PosY[3]+=2; + } + else + { PosX[0]+=1*(3-Col);PosY[0]+=1; + PosX[2]+=1*(3-Col);PosY[2]-=1; + PosY[3]-=2; + } + } + if ((Col==1)||(Col==5)||(Col==6)) + { nn=PosY[1]-PosY[0]; + PosY[0]=PosY[1]+(PosX[1]-PosX[0]); + PosX[0]=PosX[1]-nn; + nn=PosY[1]-PosY[2]; + PosY[2]=PosY[1]+(PosX[1]-PosX[2]); + PosX[2]=PosX[1]-nn; + nn=PosY[1]-PosY[3]; + PosY[3]=PosY[1]+(PosX[1]-PosX[3]); + PosX[3]=PosX[1]-nn; + } + for (nn=0; nn<4; nn++) + document.images[PosX[nn]+MaxX*PosY[nn]].src = Pic[Col+1].src; +} +function CanRotate() +{ var ii, jj, iim, jjm, dd=3; + if (Col==3) return(false); + if (Col==0) + { iim=PosX[2]-2; + jjm=PosY[2]-1; + dd=4; + } + else + { iim=PosX[1]-1; + jjm=PosY[1]-1; + } + for (ii=iim; ii0) Shift(0, dd); +} +function Shift(dx, dy) +{ var nn; + for (nn=0; nn<4; nn++) + { Fld[PosX[nn]][PosY[nn]]=0; + document.images[PosX[nn]+MaxX*PosY[nn]].src = Pic[0].src; + } + for (nn=0; nn<4; nn++) + { PosX[nn]+=dx; + PosY[nn]+=dy; + Fld[PosX[nn]][PosY[nn]]=Col+1; + document.images[PosX[nn]+MaxX*PosY[nn]].src = Pic[Col+1].src; + } +} +function Remove() +{ var xx, yy, nn=0; + Score+=20; + for (yy=0; yy=0; yy--) + { if (RFld[yy]>0) + { nn++ + for (xx=0; xx0) + { for (xx=0; xx=1500*Level)&&(Level<12)) Level++; + if (nn>0) RefreshScreen(); +} +function RefreshScreen() +{ for (i=0; i < MaxX; i++) + { for (j=0; j < MaxY; j++) + window.document.images[i+MaxX*j].src = Pic[Fld[i][j]].src; + } +} +function HideFocus() +{ if (IsHideFocus) + { document.ScoreForm.Score.focus(); + document.ScoreForm.Score.blur(); + } +} +function IncreaseDifficulty() +{ if (Level<12) + { window.document.ScoreForm.Level.value = Level + Level++; + } +} diff --git a/tgui/src/interfaces/tetris/tetris2.js b/tgui/src/interfaces/tetris/tetris2.js new file mode 100644 index 0000000000..cc9c152df4 --- /dev/null +++ b/tgui/src/interfaces/tetris/tetris2.js @@ -0,0 +1,27 @@ +document.open("text/plain"); +document.writeln("
"); +for (j=0; j < MaxY; j++) +{ document.writeln(""); + for (i=0; i < MaxX; i++) + document.write(""); + document.writeln("
"); +} +document.writeln("
"); + +if (navigator.appName == "Konqueror") +{ document.write(""); + document.write(""); + KeyCatchFocus(); + IsHideFocus=false; +} +function KeyCatchFocus() +{ setTimeout("document.forms[0].KeyCatch.focus()",100); +} +function KeyCatchChange() +{ var vv=""+document.forms[0].KeyCatch.value; + if (vv=="") return; + KeyDown(vv.charCodeAt(0)); + document.forms[0].KeyCatch.value=""; +} + +document.close();