int show_table(void) { int i; int x = 1; int y = 0; vs_head("個人課表", str_site); move(x++, y); prints("┌─┬─────┬─────┬─────┬─────┬─────┬─────┐"); move(x++, y); prints("│ │ 星期一 │ 星期二 │ 星期三 │ 星期四 │ 星期五 │ 星期六 │"); move(x++, y); prints("├─┼─────┼─────┼─────┼─────┼─────┼─────┤"); for (i = 1;i < 14;i++) { move(x++, y); prints("│%2d│ │ │ │ │ │ │", i); } move(x++, y); prints("└─┴─────┴─────┴─────┴─────┴─────┴─────┘"); move(x++, y); prints("╭─────────────────────────────────────╮"); move(x++, y); prints("│ 【課程名稱】 │"); move(x++, y); prints("│ 【授課教師】 【上課地點】 │"); move(x++, y); prints("│ 【備 註】 │"); move(x++, y); prints("╰─────────────────────────────────────╯"); help_classtable(); return 0; }
static void credit_head() { vs_head("記帳手札", str_site); prints(NECKER_CREDIT, d_cols, ""); }
static int /* 回傳 歲數 */ pip_time_update() { int oldtm, tm; /* 固定時間做的事 */ if ((time(0) - last_time) >= PIP_CHECK_PERIOD) { do { d.shit += rand() % 3 + 3; /* 不做事,還是會變髒的 */ d.tired -= 2; /* 不做事,疲勞當然減低啦 */ d.sick += rand() % 4 - 2; /* 不做事,病氣會隨機率增加減少或增加少許 */ d.happy += rand() % 4 - 2; /* 不做事,快樂會隨機率增加減少或增加少許 */ d.satisfy += rand() % 4 - 2; /* 不做事,滿足會隨機率增加減少或增加少許 */ d.hp -= rand() % 3 + d.sick / 10; /* 不做事,肚子也會餓咩,也會因生病降低一點 */ last_time += PIP_CHECK_PERIOD; /* 下次更新時間 */ } while ((time(0) - last_time) >= PIP_CHECK_PERIOD); /* 檢查年齡 */ oldtm = d.bbtime / 60 / 30; /* 更新前幾歲了 */ d.bbtime += time(0) - start_time; /* 更新小雞的時間(年齡) */ start_time = time(0); tm = d.bbtime / 60 / 30; /* 更新後幾歲了 */ /* itoc.010815.註解: 如果小雞一直在次選單中(例如戰鬥修行), 那麼會因為很久(超過30分鐘即一歲)沒有執行 pip_time_update() 而一次加好多歲 */ /* itoc.010815: 一次過好多歲會少加好多次過生日的好處,不予修正,作為虐待小雞的處罰 :p */ if (tm != oldtm) /* 歲數更新前後如果不同,表示長大了 */ { /* 長大時的增加改變值 */ count_tired(1, 7, 0, 100, 0); /* 恢復疲勞 */ d.happy += rand() % 5 + 5; d.satisfy += rand() % 5; d.wisdom += 10; d.character += rand() % 5; d.money += 500; d.seeroyalJ = 1; /* 一年可以見王子一次 */ pip_write_file(); /* 自動儲存 */ vs_head("電子養小雞", str_site); show_basic_pic(20); /* 生日快樂 */ vmsg("小雞過生日了"); /* 收穫季 */ if (tm % 2 == 0) /* 二年一次收穫季 */ pip_race_main(); /* 結局 */ if (tm >= 21 && (d.wantend == 4 || d.wantend == 5 || d.wantend == 6)) /* 玩到 20 歲 */ pip_ending_screen(); } } else { tm = d.bbtime / 60 / 30; /* 如果沒有 update,也要回傳 tm(歲數) */ } /* 偶發事件 */ oldtm = rand() % 2000; /* 借用 oldtm 做亂數 */ if (oldtm == 0 && tm >= 15 && d.charm >= 300 && d.character >= 300) pip_marriage_offer(); /* 商人來求婚 */ else if (oldtm > 1998) pip_meet_divine(); /* 隨機遇到占卜師 */ else if (oldtm > 1996) pip_meet_sysop(); /* 隨機遇到 SYSOP */ else if (oldtm > 1994) pip_meet_smith(); /* 隨機遇到鐵匠 */ /* 檢查一些常變動的值是否爆掉 */ /* itoc.010815: 在 pip_time_update() 中不必檢查 shit/tired/sick >100 或 happy/satisfy/hp < 0 而在 pip_refresh_screen() 檢查並順道宣告死亡 */ if (d.shit < 0) d.shit = 0; if (d.tired < 0) d.tired = 0; if (d.sick < 0) d.sick = 0; if (d.happy > 100) d.happy = 100; if (d.satisfy > 100) d.satisfy = 100; if (d.hp > d.maxhp) d.hp = d.maxhp; return tm; }