|
本帖最后由 清岚轩 于 2022-3-10 23:16 编辑
稍微学过一点编程,自己就抽空做了一个残疾角色生成器,想着既然做出来了就给大家分享一下。内容全是关于截肢的,其他类型我个人没什么兴趣所以暂时没做。
对类型的描述都是我自己编的,有一些上网搜的内容,非常不严谨也不是太清晰,别太介意啊。
效果图见附图,程序非常简陋
我编程能力真的很差,就学过一小段时间,完全没法跟各位大佬相比。所以做出的这个程序也很简陋,还是用键盘操作的(鼠标操作我也能弄但是对我来说太麻烦了),我都不确定里面还有没有我没发现的bug……这个程序大家拿来娱乐或者写小说的时候找灵感、生成龙套都可以。
里面有一些测试bug时候加进去的内容我没删,按提示正常使用的时候是不会碰到的,所以我就留着当彩蛋了。不过从源代码里面应该就可以看出来。
不喜欢的话各位大佬轻点喷哈,我能力确实不行……
类型我加的不太全,人名库也不完善,但是可以对付用。
附件里那个zip解压之后有个exe文件,直接运行就行了。
如果有人担心有病毒的话也没关系,源代码我放在这(C语言写的),还是不放心的的话可以自己找个编译器运行这段源代码:
#include <stdio.h>
#include <windows.h>
#include <time.h>
char names[3][110][10]={
{"赵","钱","孙","李","周","吴","郑","王","冯","陈","楮","卫","蒋","沈","韩","杨","朱","秦","尤","许","何","吕","施","张","孔","曹","严","华","金","魏","陶","姜","戚","谢","邹","喻","柏","水","窦","章","云","苏","潘","葛","奚","范","彭","郎","滕","殷","罗","毕","郝","邬","安","常","乐","于","时","傅","皮","卞","齐","康"},
{"泽林","沛荣","嘉浩","时茂","睿哲","志源","昀然","知新","熙贤","于海","锦凯","梓航","俊栋","祺宇","宇杰","展鹏","智渊","宇辰","浩栋","博然","俊杰","浩志","泽怀","正清","怀德","怀德","杰凡","天祺","天宇","俊成","轩宇","泽宇","振华","千志","祥麟","锦荣","禹东","浩然","锐泽","向荣","博明","博胜","俊瀚","骏年","康胜","希杰","嘉荣","学海","玉泽","宏义","荣昕","辰皓","依瑞","梓勇","骏喆","俊英","和正","锐意","泽宇","俊德","宏博","俊誉","昊然","正志","杰文","锦伦","瑞谦","宏峻","博然","悦鑫","昌宇","靖宇","茂琪","佳俊","锦骏","景凯","昊文","子鸣","智宇","恒毅","齐卓","润文","德浩","靖翰","俊凯","文栋","浩熙","元俊","玮润","嘉宇","嘉豪","喆依","辰哲","柳林","星海","祥熠","盛铭","鹏志","润浩","锐翰","Herobrine"},
{"倩雪","玉珍","茹雪","正梅","美琳","欢馨","优璇","雨嘉","娅楠","明美","可馨","惠茜","漫妮","香茹","月婵","嫦曦","静香","梦洁","凌薇","美莲","雅静","雪丽","依娜","雅芙","雨婷","怡香","珺瑶","梦瑶","婉婷","睿婕","雅琳","静琪","彦妮","馨蕊","静宸","雪慧","淑颖","乐姗","玥怡","芸熙","钰彤","璟雯","天瑜","婧琪","梦瑶","静宸","诗琪","美萱","雪雁","煜婷","笑怡","优璇","雨嘉","雨婷","玥婷","芸萱","馨彤","沛玲","语嫣","凌菲","羽馨","靖瑶","瑾萱","漫妮","欣妍","玉珍","茹雪","正梅","美琳","欢馨","优璇","雨嘉","明美","可馨","惠茜","漫妮","香茹","月婵","嫦曦","静香","梦洁","凌薇","美莲","雅静","雪丽","韵寒","莉姿","梦璐","沛玲","欣妍","初雪","子淇","婉桐","雪","月","灵","欣","雨","梦","冰"}};
struct LIMB{
int length;
int finger[6];
};
struct RW{
int type;
int sex;
int age;
int head;
int body;
struct LIMB limbs[5];
};
struct RW rw[110];
int rs=0,areg[5]={123,12,14,14,12};
int D(int x)
{
return rand()%x+1;
}
int prname(int sex)
{
char name[100];
strcpy(name,names[0][D(64)-1]);
strcat(name,names[sex][D(100)-1]);
puts(name);
}
int create()
{
int limb[5],sjs;
rs++;
sjs=D(100);
if(sjs<=20)
{
rw[rs].sex=1;
}
else if(sjs<=95)
{
rw[rs].sex=2;
}
else
{
rw[rs].sex=3;
}
sjs=D(100);
if(sjs<=90)
{
rw[rs].age=D(5)+D(5)+D(5)+D(5)+D(5);
if(rw[rs].age<=10)
{
rw[rs].age=D(5)+D(5)+D(5)+D(5)+D(5);
}
}
else
{
rw[rs].age=D(10)+D(10)+D(10)+D(10)+D(10);
if(rw[rs].age<=10)
{
rw[rs].age=D(10)+D(10)+D(10)+D(10)+D(10);
}
}
rw[rs].type=1;//待更新
if(rw[rs].type==1)
{
// printf("1型\n");
rw[rs].type=1;
// printf("\nf2\n");
for(int i=1;i<=4;i++)
{
limb=D(3);
// printf("\nf3:%d,%d\n",i,limb);
switch(limb)
{
case 1:
// printf("\nf8:%d,%d\n",i,limb,rw[rs].limbs.length);
rw[rs].limbs.length=areg;
// printf("\nf4:%d,%d\n",i,limb,rw[rs].limbs.length);
break;
case 2:
// printf("\nf9:%d,%d,%d\n",i,limb,rw[rs].limbs.length,areg);
rw[rs].limbs.length=D(areg);
// printf("\nf5:%d,%d\n",i,limb,rw[rs].limbs.length);
break;
case 3:
// printf("\nf10:%d,%d\n",i,limb,rw[rs].limbs.length);
rw[rs].limbs.length=1;
// printf("\nf6:%d,%d\n",i,limb,rw[rs].limbs.length);
break;
default:
printf("\nf7:%d,%d\n",i,limb,rw[rs].limbs.length);
return 1;
}
}
// printf("\nf1\n");
}
else
{
// printf("2型\n");
}
return 0;
}
int prrw()
{
printf("人物%d\n",rs);
printf("姓名:");
if(rw[rs].sex==3)
{
prname(D(2));
}
else
{
prname(rw[rs].sex);
}
// printf("\nf11:%d\n",rw[rs].sex);
switch(rw[rs].sex)
{
case 1:
printf("性别:男\n");
break;
case 2:
printf("性别:女\n");
break;
case 3:
printf("性别:中性\n");
break;
default:
return 1;
}
printf("年龄%d\n",rw[rs].age);
// printf("f17:%d\n",rs);
// for(int i=1;i<=4;i++)
// {
// printf("f%d:%d\n",i+12,rw[rs].limbs.length);
// }
printf("左臂:");
switch(rw[rs].limbs[1].length)
{
case 1:
printf("肩离断\n");
break;
case 2:
printf("肩部外科颈位置以下截肢\n");
break;
case 3:
printf("大臂中段截肢\n");
break;
case 4:
printf("肘部截肢\n");
break;
case 5:
printf("小臂中段截肢\n");
break;
case 6:
case 7:
printf("手腕截肢\n");
break;
case 8:
printf("大拇指、中指及无名指截肢\n");
break;
case 9:
printf("食指、中指截肢\n");
break;
case 10:
printf("中指、无名指截肢\n");
break;
case 11:
printf("大拇指截肢\n");
break;
case 12:
printf("完整\n");
break;
default:
printf("f18:%d\n",rw[rs].limbs[1].length);
return 2;
}
printf("右臂:");
switch(rw[rs].limbs[4].length)
{
case 1:
printf("肩离断\n");
break;
case 2:
printf("肩部外科颈位置以下截肢\n");
break;
case 3:
printf("大臂中段截肢\n");
break;
case 4:
printf("肘部截肢\n");
break;
case 5:
printf("小臂中段截肢\n");
break;
case 6:
case 7:
printf("手腕截肢\n");
break;
case 8:
printf("大拇指、中指及无名指截肢\n");
break;
case 9:
printf("食指、中指截肢\n");
break;
case 10:
printf("中指、无名指截肢\n");
break;
case 11:
printf("大拇指截肢\n");
break;
case 12:
printf("完整\n");
break;
default:
printf("f19:%d\n",rw[rs].limbs[4].length);
return 2;
}
printf("左腿:");
switch(rw[rs].limbs[2].length)
{
case 1:
printf("大腿根部截肢\n");
break;
case 2:
printf("半骨盆截肢\n");
break;
case 3:
printf("反转脚\n");
break;
case 4:
printf("大腿中段截肢\n");
break;
case 5:
printf("膝盖处截肢\n");
break;
case 6:
printf("膝下10cm截肢\n");
break;
case 7:
printf("膝下20cm截肢\n");
break;
case 8:
printf("脚踝处截肢\n");
break;
case 9:
printf("截去大半个脚掌,只保留脚跟\n");
break;
case 10:
printf("截去全部脚趾\n");
break;
case 11:
printf("截去1,2,3趾(从大脚趾开始计算)\n");
break;
case 12:
printf("截去1,3,4趾(从大脚趾开始计算)\n");
break;
case 13:
printf("截去1,3趾(从大脚趾开始计算)\n");
break;
case 14:
printf("完整\n");
break;
default:
printf("f20:%d\n",rw[rs].limbs[2].length);
return 2;
}
printf("右腿:");
switch(rw[rs].limbs[3].length)
{
case 1:
printf("大腿根部截肢\n");
break;
case 2:
printf("半骨盆截肢\n");
break;
case 3:
printf("反转脚\n");
break;
case 4:
printf("大腿中段截肢\n");
break;
case 5:
printf("膝盖处截肢\n");
break;
case 6:
printf("膝下10cm截肢\n");
break;
case 7:
printf("膝下20cm截肢\n");
break;
case 8:
printf("脚踝处截肢\n");
break;
case 9:
printf("截去大半个脚掌,只保留脚跟\n");
break;
case 10:
printf("截去全部脚趾\n");
break;
case 11:
printf("截去1,2,3趾(从大脚趾开始计算)\n");
break;
case 12:
printf("截去1,3,4趾(从大脚趾开始计算)\n");
break;
case 13:
printf("截去1,3趾(从大脚趾开始计算)\n");
break;
case 14:
printf("完整\n");
break;
default:
printf("f21:%d\n",rw[rs].limbs[3].length);
return 2;
}
return 0;
}
int main()
{
srand(time(0));
while(1)
{
char a=0;
// for(int i=1;i<=100;i++)
// {
// prname(i%4);
// }
printf("输入a生成角色,输入e退出\n");
a=getchar();
getchar();
switch(a)
{
case 'a':
create();
if(prrw()==2)
{
printf("f12\n");
}
// printf("%d\n",D(6));
break;
case 'e':
return 0;
case 'b':
prname(1);
break;
case 'g':
prname(2);
break;
case 'y':
printf("%d\n",D(10));
break;
default:
continue;
}
}
return 1;
}
视个人时间安排和大家的态度我以后可能会继续更新、完善这个程序,大家有什么建议也欢迎提出来哈。
目前打算有空更新以下功能:
1.更多类型
2.更合理的生成概率
3.更完善的人名库
4.更多细节
5.人设的身份、背景
6.这个人的一个小故事
7.人设存档
8.对类型进行筛选
9.修复可能存在的bug
10.优化程序的占用空间和运行速度
11.使用更严谨、更易理解的类型描述方式
12.移除HIM(看不懂的话不要介意,我只是玩个梗)
有什么意见和建议尽管提,我会考虑的!
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|