Skip to content

Instantly share code, notes, and snippets.

View lctseng's full-sized avatar

Liang-Chi Tseng lctseng

View GitHub Profile
@lctseng
lctseng / RGSS3片段解析:技能增加變數.rb
Last active August 29, 2015 14:04
RGSS3片段解析:技能增加變數
# 先到腳本Game_Battler的第411行附近找到以下腳本片段:
#--------------------------------------------------------------------------
# ● 技能/使用物品
# 對使用目標使用完畢后,應用對于使用目標以外的效果。
#--------------------------------------------------------------------------
def use_item(item)
pay_skill_cost(item) if item.is_a?(RPG::Skill)
consume_item(item) if item.is_a?(RPG::Item)
item.effects.each {|effect| item_global_effect_apply(effect) }
end
@lctseng
lctseng / RGSS3片段解析:殺怪增加變數.rb
Last active August 29, 2015 14:04
RGSS3片段解析:殺怪增加變數
# 這個可以用腳本做
# 於Game_Enemy腳本中,定義敵人死亡時需要額外做的事情
# 在Game_Enemy腳本列中,額外增加以下方法(method),記得要放在正確的位置(和其他方法一樣的位置)
# 範例:在1號開關開啟時,2號敵人死掉時,3號變數加4
#--------------------------------------------------------------------------
# ● 死亡
#--------------------------------------------------------------------------
def die
super
puts "#{self.name}死亡!"
#==============================================================================
# ■ 畫面大小更改
#------------------------------------------------------------------------------
# 畫面大小更改
#==============================================================================
Graphics.resize_screen(640,480)
#Basic Window Resizer v1.1
#----------#
#Features: Allows you to resize the window to whatever size you like! (This is not
# like Graphics.resize, this will scale to fit)
@lctseng
lctseng / RGSS3片段:取得非裝備能力加成.rb
Last active August 29, 2015 14:04
RGSS3片段:取得非裝備能力加成
class Game_Actor < Game_Battler
# 在開頭插入這一行
alias :super_param_plus :param_plus
# 剩下的程式碼...
@lctseng
lctseng / RGSS2片段:戰鬥經驗值變數化.rb
Last active August 29, 2015 14:04
RGSS2片段:戰鬥經驗值變數化
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
#  處理角色的類。本類在 Game_Actors 類 ($game_actors) 的內部使用、
# Game_Party 類請參考 ($game_party) 。
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 獲取經驗值變數
@lctseng
lctseng / RGSS3:敵我情報.rb
Last active August 29, 2015 14:05
RGSS3:敵我情報,支援多行屬性
#==============================================================================
# ■ RGSS3 状況確認コマンド Ver1.05 by 星潟
#------------------------------------------------------------------------------
# RPGツクールVXAceでは、現在のステートや強化/弱体の表示数が
# 著しく制限されており、非常に確認し辛いです。
#
# しかし、状況確認コマンドではステートを22個、強化/弱体も全て表示されます。
#
# パーティコマンドに、敵味方の現在能力値やステート/強化/弱体の状態を
# 確認する為の新規コマンドを追加します。
@lctseng
lctseng / RGSS3全螢幕腳本.rb
Last active August 29, 2015 14:06
RGSS3全螢幕腳本
#==============================================================================
# ■ 畫面大小更改
#------------------------------------------------------------------------------
# 畫面大小更改
#==============================================================================
Graphics.resize_screen(640,480)
#Basic Window Resizer v1.1
#----------#
#Features: Allows you to resize the window to whatever size you like! (This is not
# like Graphics.resize, this will scale to fit)
@lctseng
lctseng / Compiler-Hw2-Checker.sh
Last active August 29, 2015 14:10
可以用來快速套用testcase來檢查正確性,不會用此程式,請找原作者謝謝~
#!/bin/sh
chmod +x parser
echo "====CORRECT check start===="
error_cnt=0
for file in ./testcases/correct/*
do
echo "check $file"
./parser $file > .check.tmp 2>&1
if [ $? -ne 0 ]; then
echo "***ERROR:Unable to resolve CORRECT syntax in $file***"
cudaError_t cudaStatus;
cudaStatus = cudaGetLastError();
if (cudaStatus != cudaSuccess) {
fprintf(stderr, "Kernel launch failed: %s\n", cudaGetErrorString(cudaStatus));
}
@lctseng
lctseng / RGSS:寫入Bitmap物件.rb
Last active August 29, 2015 14:13
RGSS:寫入Bitmap物件
class Font
def marshal_dump;end
def marshal_load(obj);end
end
class Bitmap
# メモリ転送用の関数
RtlMoveMemory_pi = Win32API.new('kernel32', 'RtlMoveMemory', 'pii', 'i')
RtlMoveMemory_ip = Win32API.new('kernel32', 'RtlMoveMemory', 'ipi', 'i')
def _dump(limit)
data = "rgba" * width * height