3DMGAME 3DM首页 新闻中心 前瞻 | 评测 游戏库 热门 | 最新 攻略中心 攻略 | 秘籍 下载中心 游戏 | 汉化 购买正版 论坛

注册 登录

QQ登录

只需一步,快速开始

查看: 20290|回复: 42
打印 上一主题 下一主题

[原创] 《收获日2》lua代码小原创,加强版医疗包和哨兵守卫,持续更新(NO3。更新面具材料图案颜色解锁,累感无爱)

  [复制链接]

7

主题

145

帖子

509

积分

高级玩家

Rank: 4

贡献度
52
金元
3007
积分
509
精华
0
注册时间
2012-10-20
跳转到指定楼层
主题
发表于 2013-8-23 03:44 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Uncle_Muscle 于 2013-8-23 16:58 编辑

不知道lua代码是什么,怎么用的请看这里,教程和注入工具都在:
http://bbs.3dmgame.com/thread-3981125-1-1.html

今晚闲着没事,翻了一下lua的原代码,捡几个改了一下,然后试了一试真的有效果唉,好开心。。。。
我没怎么学过编程也不是计算机专业的,所以这次改了点代码巨有成就感。。。
所以小技术请大家不要打击,多多支持,而且在3DM发帖也是第一次。。。原来打算在贴吧发的。。代码一复制上去格式就乱了
想着破解和汉化都是用3DM的,所以就来3DM发啦,莫打击莫打击
收获日2
steam:357539725
昵称:joker_lu

代码如下:
医疗包(单个医疗包无限治疗效果,四个人怎么都吃不完)
无限医疗包.lua (319 Bytes, 下载次数: 6459)

function DoctorBagBase:_take( unit )
        --local taken = 1 - unit:character_damage():health_ratio()
        local taken = 1
        
        self._amount = self._amount
        unit:character_damage():recover_health() -- replenish()
        return taken
end

哨兵机枪(机枪无限弹、无敌,好爽好爽,游戏开始挑敌人多的地方放一个,它一直突突到你们撤离)
无限机枪.lua (2.66 KB, 下载次数: 2430)

function SentryGunWeaponut_of_ammo()
        if self._ammo_total then
                return self._ammo_total == 9999
        else
                return self._ammo_ratio == 1
        end
end

function SentryGunWeapon:fire( blanks, expend_ammo )
        if expend_ammo then
                if self._ammo_total <= 0 then
                        return
                end
                self._ammo_total = self._ammo_total - 0

                local ammo_percent = self._ammo_total / self._ammo_total
                if ammo_percent == 0 or math.abs( ammo_percent - self._ammo_sync ) >= self._ammo_sync_resolution then
                        self._ammo_sync = ammo_percent
                        self._unit:network():send( "sentrygun_ammo", math.ceil( ammo_percent / self._ammo_sync_resolution ) )
                end
        end
        
        local fire_obj = self._effect_align[ self._interleaving_fire ]
        local from_pos = fire_obj:position()
        local direction = fire_obj:rotation():y()
        -- mvector3.negate( direction )
        mvector3.spread( direction, tweak_data.weapon[ self._name_id ].SPREAD * self._spread_mul )
        World:effect_manager():spawn( self._muzzle_effect_table[ self._interleaving_fire ] ) -- , normal = col_ray.normal } )
        if self._use_shell_ejection_effect then
                World:effect_manager():spawn( self._shell_ejection_effect_table )
        end
        local ray_res = self:_fire_raycast( from_pos, direction, blanks )
        if self._alert_events and ray_res.rays then
                RaycastWeaponBase._check_alert( self, ray_res.rays, from_pos, direction, self._unit )
        end
        
        self._unit:movement():give_recoil()
        
        return ray_res
end


function SentryGunDamage:damage_bullet( attack_data )
        --print( "[SentryGunDamage:damage_bullet]", inspect( attack_data ) )
        if self._dead or self._invulnerable or PlayerDamage:_look_for_friendly_fire( attack_data.attacker_unit ) then
                return
        end
        
        local hit_shield = attack_data.col_ray.body and attack_data.col_ray.body:name() == self._shield_body_name
        local hit_bag = attack_data.col_ray.body and attack_data.col_ray.body:name() == self._bag_body_name
        local dmg_adjusted = attack_data.damage * ( hit_shield and tweak_data.weapon.sentry_gun.SHIELD_DMG_MUL or 1 ) * ( hit_bag and tweak_data.weapon.sentry_gun.BAG_DMG_MUL or 1 )
        -- print( "hit_shield", hit_shield, "hit_bag", hit_bag, "damage", attack_data.damage, "dmg_adjusted", dmg_adjusted  )
        if dmg_adjusted >= self._health then
                self:die()
        else
                self._health = self._health
        end
        
        local health_percent = self._health / self._health_max
        if health_percent == 0 or math.abs( health_percent - self._health_sync ) >= self._health_sync_resolution then
                self._health_sync = health_percent
                self._unit:network():send( "sentrygun_health", math.ceil( health_percent / self._health_sync_resolution ) )
        end
        
end



——————————————————————
第一次发帖哦,第一次哦,回复多的话会考虑更新的


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第三次更新,面具的材料图案颜色,累感无爱,帖子都没人理的……本小学生自己写的啊,再没人爱去玩CF了!!!!!

面具解锁代码
managers.blackmarket:_setup_masks()

for mask_id,_ in pairs(tweak_data.blackmarket.masks) do

Global.blackmarket_manager.masks[mask_id].unlocked = true

managers.blackmarket:add_to_inventory("normal", "masks", mask_id, false)

end

颜色解锁代码
for color_id,_ in pairs(tweak_data.blackmarket.colors) do

tweak_data.blackmarket.colors[ texture_id ].unlocked = true

managers.blackmarket:add_to_inventory("normal", "colors", color_id, false)

end

图案解锁代码
for texture_id,_ in pairs(tweak_data.blackmarket.textures) do

tweak_data.blackmarket.textures[ texture_id ].unlocked = true

managers.blackmarket:add_to_inventory("normal", "textures", texture_id, false)

end

材料解锁代码
for material_id,_ in pairs(tweak_data.blackmarket.materials) do

tweak_data.blackmarket.materials[ material_id ].unlocked = true

managers.blackmarket:add_to_inventory("normal", "materials", material_id, false)

end





面具材料图案颜色解锁.lua

1004 Bytes, 下载次数: 1351

评分

4

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|3DMGAME ( 京ICP备14006952号-1  沪公网安备 31011202006753号

GMT+8, 2026-4-5 17:59 , Processed in 0.028483 second(s), 18 queries , Memcached On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表