-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
4,706 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
################## データ保存 ################## | ||
use strict; | ||
#use warnings; | ||
use utf8; | ||
|
||
sub data_calc { | ||
my %pc = %{$_[0]}; | ||
|
||
### レベル・成長 -------------------------------------------------- | ||
## 履歴から | ||
$pc{'enduranceGrow'} = $pc{'endurancePreGrow'}; | ||
$pc{'initiativeGrow'} = $pc{'initiativePreGrow'}; | ||
|
||
foreach my $i (0 .. $pc{'historyNum'}){ | ||
if ($pc{"history${i}Grow"} eq 'endurance' ) { $pc{'enduranceGrow'} += 5; } | ||
elsif($pc{"history${i}Grow"} eq 'initiative') { $pc{'initiativeGrow'} += 2; } | ||
$pc{'level'} = 1 + ($pc{"enduranceGrow"} / 5) + ($pc{"initiativeGrow"} / 2); | ||
} | ||
|
||
### 能力値 -------------------------------------------------- | ||
if ($pc{'factor'} eq '人間'){ | ||
$pc{'endurance'} = $pc{'statusMain1'} * 2 + $pc{'statusMain2'}; | ||
$pc{'initiative'} = $pc{'statusMain2'} + 10; | ||
} | ||
elsif($pc{'factor'} eq '吸血鬼'){ | ||
$pc{'endurance'} = $pc{'statusMain1'} + 20; | ||
$pc{'initiative'} = $pc{'statusMain2'} + 4; | ||
} | ||
$pc{'endurance'} += $pc{'enduranceAdd'} + $pc{'enduranceGrow'}; | ||
$pc{'initiative'} += $pc{'initiativeAdd'} + $pc{'initiativeGrow'}; | ||
|
||
### 0を消去 -------------------------------------------------- | ||
#foreach ( | ||
# '', | ||
#){ | ||
# delete $pc{$_} if !$pc{$_}; | ||
#} | ||
|
||
#### 改行を<br>に変換 -------------------------------------------------- | ||
$pc{'words'} =~ s/\r\n?|\n/<br>/g; | ||
$pc{'freeNote'} =~ s/\r\n?|\n/<br>/g; | ||
$pc{'freeHistory'} =~ s/\r\n?|\n/<br>/g; | ||
$pc{'chatPalette'} =~ s/\r\n?|\n/<br>/g; | ||
$pc{'scarNote'} =~ s/\r\n?|\n/<br>/g; | ||
|
||
### newline -------------------------------------------------- | ||
my($name, undef) = split(/:/,$pc{'characterName'}); | ||
my($aka, undef) = split(/:/,$pc{'aka'}); | ||
my $charactername = ($aka?"“$aka”":"").$name; | ||
$charactername =~ s/[||]([^||]+?)《.+?》/$1/g; | ||
$::newline = "$pc{'id'}<>$::file<>". | ||
"$pc{'birthTime'}<>$::now<>$charactername<>$pc{'playerName'}<>$pc{'group'}<>". | ||
"$pc{'factor'}<>$pc{'factorCore'}<>$pc{'factorStyle'}<>". | ||
"$pc{'gender'}<>$pc{'age'}<>$pc{'ageApp'}<>". | ||
"$pc{'belong'}<>$pc{'missing'}<>". | ||
"$pc{'level'}<>". | ||
|
||
"$pc{'sessionTotal'}<>$pc{'image'}<> $pc{'tags'} <>$pc{'hide'}<><>"; | ||
|
||
return %pc; | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
################# デフォルト設定 ################# | ||
use strict; | ||
use utf8; | ||
|
||
package set; | ||
|
||
# config.cgiのほうが優先されます | ||
# 変更する場合は同様の項目をconfig.cgiに追記してください | ||
# (CGIアップデート時に上書きされるため) | ||
|
||
## ●タイトル | ||
our $title = 'ゆとシートⅡ for BLP'; | ||
|
||
## ●管理パスワード | ||
our $masterkey = ''; | ||
|
||
## ●管理人ユーザーID (指定したIDは非表示のシートの閲覧や全シートの編集ができます) | ||
our $masterid = ''; | ||
|
||
## ●登録関係 | ||
# 登録キー | ||
our $registerkey = ''; | ||
# データ作成・編集にユーザー登録(ログイン状態)を必須にする | ||
our $user_reqd = 0; | ||
# キャラクター・魔物のIDをランダムではなくユーザーID+番号(001,002..)にする(魔物はm001..) | ||
our $id_type = 0; | ||
|
||
## ●OAuth2 でのログイン関係 | ||
# OAuth2 を提供するサービスの名称。現在 Discord と Google のみ対応 | ||
our $oauth_service = ''; | ||
# OAuth2 で利用するサービスにユーザがログインするための URL | ||
our $oauth_login_url = ''; | ||
# OAuth2 で利用するサービスから払い出される client_id | ||
our $oauth_client_id = ''; | ||
# OAuth2 で利用するサービスから払い出される client_secret | ||
our $oauth_secret_id = ''; | ||
# ゆとシート2 の URL のうち index.cgi を oauth.cgi に置換したもの | ||
our $oauth_redirect_url = ''; | ||
# OAuth2 のスコープ | ||
our $oauth_scope = ''; | ||
|
||
# OAuth で Discord を利用する場合のみ利用可能 ログインを許可する Discord のサーバ一覧。空リストの場合は制限しない | ||
our @oauth_discord_login_servers = (); | ||
|
||
## ●画像関係 | ||
# キャラクター画像のファイルサイズ上限(単位byte) | ||
our $image_maxsize = 1024 * 1024 * 1; | ||
|
||
|
||
## ●削除関係 | ||
# データを削除するとき、バックアップも削除 する=1 しない=0 | ||
our $del_back = 0; | ||
|
||
## ●一覧表示関係 | ||
# キャラクター一覧を簡易表示にする | ||
our $simplelist = 0; | ||
|
||
## ●グループ設定 | ||
# ["ID", "ソート順(空欄で非表示)", "分類名", "分類の説明文"], | ||
# 選択時はここで書いた順番、キャラ一覧(グループ別)ではソート順で数字が小さい方から表示されます | ||
# 増減OK | ||
our @groups = ( | ||
["pc", "01", "PC", "プレイヤーキャラクター"], | ||
["npc", "99", "NPC", "ノンプレイヤーキャラクター"], | ||
); | ||
|
||
# デフォルトのグループID | ||
our $group_default = 'pc'; | ||
|
||
# トップページのキャラクター最大表示数(1グループあたり/無制限=0) | ||
our $list_maxline = 0; | ||
|
||
# グループ個別表示時や検索結果表示時の1ページあたりの最大表示数(0で全部表示) | ||
our $pagemax = 0; | ||
|
||
|
||
## ●キャラクターシートの各種初期値 | ||
our $make_endurance = 0; | ||
our $make_initiative = 0; | ||
|
||
|
||
## ●Cookie | ||
# Cookieの名前 | ||
our $cookie = 'ytsheet2'; | ||
|
||
## ●各種ファイルへのパス | ||
our $sendmail = '/usr/sbin/sendmail'; # sendmailのパス | ||
our $admimail = '[email protected]'; # 管理者(システムメール送信元)メールアドレス | ||
|
||
our $data_dir = './data/'; # データ格納ディレクトリ | ||
our $passfile = $data_dir . 'charpass.cgi'; # パスワード記録ファイル | ||
our $listfile = $data_dir . 'charlist.cgi'; # キャラクター一覧ファイル | ||
our $char_dir = $data_dir . 'chara/'; # キャラクターデータ格納ディレクトリ | ||
|
||
our $userfile = $::core_dir . '/data/users.cgi'; # ユーザー一覧ファイル | ||
our $login_users = $::core_dir . '/data/login_users.cgi'; # ログイン情報保存ファイル | ||
our $tokenfile = $::core_dir . '/data/token.cgi'; # 一時トークン保存ファイル | ||
|
||
our $lib_form = $::core_dir . '/lib/form.pl'; | ||
our $lib_info = $::core_dir . '/lib/info.pl'; | ||
our $lib_register = $::core_dir . '/lib/register.pl'; | ||
our $lib_reminder = $::core_dir . '/lib/reminder.pl'; | ||
our $lib_delete = $::core_dir . '/lib/delete.pl'; | ||
|
||
# 編集画面 | ||
our $lib_edit = $::core_dir . '/lib/edit.pl'; | ||
our $lib_edit_char = $::core_dir . '/lib/blp/edit-chara.pl'; | ||
# 保存処理 | ||
our $lib_save = $::core_dir . '/lib/save.pl'; | ||
our $lib_calc_char = $::core_dir . '/lib/blp/calc-chara.pl'; | ||
# シート表示 | ||
our $lib_view = $::core_dir . '/lib/view.pl'; | ||
our $lib_view_char = $::core_dir . '/lib/blp/view-chara.pl'; | ||
# チャットパレット | ||
our $lib_palette = $::core_dir . '/lib/palette.pl'; | ||
our $lib_palette_sub = $::core_dir . '/lib/blp/palette-sub.pl'; | ||
# 一覧 | ||
our $lib_list_char = $::core_dir . '/lib/blp/list-chara.pl'; | ||
# JSON出力 | ||
our $lib_json = $::core_dir . '/lib/json.pl'; | ||
our $lib_json_sub = $::core_dir . '/lib/blp/json-sub.pl'; | ||
# コンバート | ||
our $lib_convert = $::core_dir . '/lib/blp/convert.pl'; | ||
|
||
# 各種データ | ||
|
||
# HTMLテンプレート | ||
our $skin_tmpl = $::core_dir . '/skin/blp/index.html'; # 一覧/登録フォーム等の大枠 | ||
our $skin_sheet = $::core_dir . '/skin/blp/sheet-chara.html'; # キャラクターシート | ||
|
||
1; |
Oops, something went wrong.